Vector Calc Homework: Find Dv from Pr & Pt

  • Thread starter Thread starter Alienufo736
  • Start date Start date
  • Tags Tags
    Calculation Vector
Click For Summary
SUMMARY

The discussion focuses on calculating the directional vector (Dv) for a GPS tracking system in a game, where Pr represents the object's GPS coordinates and Pt represents the target GPS coordinates. The user successfully derived the angle Theta using the formula Theta = atan(Y, X) - Yaw, where Yaw is the object's facing direction. The final equation for the directional vector is established as Dv = (cos(Theta), sin(Theta)), allowing for the determination of the direction towards the target GPS from the object's current position.

PREREQUISITES
  • Understanding of trigonometric functions, specifically sine and cosine.
  • Familiarity with the atan function for angle calculation.
  • Basic knowledge of GPS coordinate systems and their representation in a 2D plane.
  • Concept of Yaw in relation to object orientation in a coordinate system.
NEXT STEPS
  • Research the implementation of GPS tracking algorithms in game development.
  • Learn about vector mathematics and its applications in 2D game physics.
  • Explore advanced trigonometric functions and their usage in directional calculations.
  • Investigate the integration of GPS data with game engines for real-time tracking.
USEFUL FOR

Game developers, programmers working on GPS-based applications, and anyone interested in implementing directional calculations in 2D environments.

Alienufo736
Messages
1
Reaction score
0

Homework Statement


Im not sure where exactly i should post this, but I am going to assume its here. basicaly what i am working on is programming a GPS tracking system inside a game. i have two GPS coordinates, one of the object that will be moving towards a stationary gps, and a stationary "target" GPS. I've figured out that it will be two points on a plane, what i need is the equation to find Dv or the direction to the Target GPS from the object GPS relative to the direction the object is facing . I've drawn a picture to assist myself in finding out exactly what i need to do.
Triangulation2.jpg

Pr=Gps on object, the line that contains Pr represents the direction that the object is facing, Pt=Target Gps, Dv=Directional Vector, Theta = Angle to Pt, Ignore Dv+ and Dv- i simply put that there to say that one side of Pr will be negative and the other positive along Dv. what i need to know is how to get the value of Dv with an equation. The Large circle around Pr represents its rotational possibilities. Note Dv must always be perpendicular to the Line Pr is in (which represents the object)

2. The attempt at a solution
I think I've figured out how to get Theta, but i could be wrong:
X = Xr - Xt
Y = Yr - Yt
Theta = atan(Y,X)-Yaw

Yr and Yt being the Y values of Pr And Pt Respectively
Xr and Xt being the Y values of Pr And Pt Respectively
Yaw being the direction the object is facing relative to the world within -180 to 180 Degrees Any help would be appreciated, i hope i explained everything alright, if not, just ask, ill elaborate.
 
Last edited:
Physics news on Phys.org
Homework EquationsX = Xr - XtY = Yr - YtTheta = atan(Y,X)-YawThe AnswerThe equation you need to calculate the directional vector (Dv) is:Dv = (cos(Theta), sin(Theta))Where Theta is the angle between the Pr line and the Pt point, which you have calculated as:Theta = atan(Y,X)-YawTherefore, the equation for the directional vector (Dv) is:Dv = (cos(atan(Y,X)-Yaw), sin(atan(Y,X)-Yaw))
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 88 ·
3
Replies
88
Views
9K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 20 ·
Replies
20
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K