I'm attempting SCIENCE by using math that I have never used before, nor do I understand (despite reading numerous articles, watching all of the khanacademy videos, etc etc)(adsbygoogle = window.adsbygoogle || []).push({});

I'm attempting to use trig to locate a point directly behind another player in Minecraft.

I've read through these three pages:

http://stackoverflow.com/questions/...rotational-axis-and-a-direction-calculate-end

http://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates

http://www.opentk.com/node/2505 [Broken]

and have come up with this code:

I know nothing about matrices (which some have suggested), nor do I know very much about trig. If anybody would be kind enough to explain a bit about those two subjects (or whichever one would help me with my problem), I would be very grateful.Code (Text):

double dEntityDistance = getPlayer().getDistanceToEntity(player);

double dNewX = /* The current player */getPlayer().posX - dEntityDistance * Math.sin(Math.toRadians(/* The player we want the position behind */ player.rotationYaw % 360)) * Math.cos(Math.toRadians(-player.rotationPitch));

double dNewZ = getPlayer().posZ - dEntityDistance * Math.cos(Math.toRadians(player.rotationYaw % 360)) * Math.cos(Math.toRadians(-player.rotationPitch));

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Finding the position directly behind a player

Loading...

Similar Threads - Finding position directly | Date |
---|---|

I Can i find this integral in a simpler way | Jan 14, 2018 |

I Q about finding area with double/volume with triple integral | Sep 13, 2017 |

I Finding a unit normal to a surface | Sep 13, 2017 |

Find a unit vector with a positive first coordinate orthogonal to both 'a' and 'b' | Sep 21, 2008 |

Finding Jacobian based on end-effector orientation instead of position | Jul 23, 2008 |

**Physics Forums - The Fusion of Science and Community**