diff --git a/README.md b/README.md index fcf1819..2169140 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,22 @@ It is a type of motion in which an object moves in a straight line at a constant Today we will use [Nukkit](https://cloudburstmc.org/articles/) as software to run our program to calculate the URM, we will also use the [Projectiles](https://minecraft-archive.fandom.com/wiki/Category:Projectiles) entities which have an in-game URM, from the position you launch it to where it lands. +First of all, we make a normal Nukkit plugin, we will make a listener class and use two events "ProjectileLaunchEvent" (called when an entity launches a projectile) and "ProjectileHitEvent" (called when the projectile hits something). + +We will use nbt to store two pieces of data, the time at which the projectile is launched (initial time) and the vector from where the projectile was launched (initial position / start). + +by calling "onProjectileLaunch", we will save the data already mentioned above. + +now for the "onProjectileHit" side, we will do all the calculations. + +we get the initial time and the initial position, also the current time and the current position. + +### Distance: To calculate the distance, we use the "distance" function of the vector3 class of the start vector. + +### Time: To calculate the time, we will do a simple operation, subtract the current time from the initial time and divide it by 1000, since both the initial time and the current time are given in milliseconds. + +### Velocity: To calculate the speed we divide the distance between the time + # Scheme with the formulas used ![Scheme](https://i.imgur.com/0xJWHY6.png)