How Can I Program Target Motion Analysis Considering 360 Degrees?

  • Context: Undergrad 
  • Thread starter Thread starter thomas576
  • Start date Start date
  • Tags Tags
    Trig
Click For Summary
SUMMARY

The discussion focuses on programming target motion analysis to determine the relative position of objects based on a heading in a 360-degree coordinate system. The user seeks a solution to identify whether a contact is on the right or left side of a boat heading at a specific bearing. The proposed solution involves calculating the relative bearing using the formula: Relative_bearing = Bearing - Heading, adjusting for negative values, and determining the side based on whether the relative bearing is less than or greater than 180 degrees. This approach effectively resolves the issue of bearing skew when the heading is between 0 and 360 degrees.

PREREQUISITES
  • Understanding of basic trigonometry and angles
  • Familiarity with programming concepts, particularly conditional statements
  • Knowledge of coordinate systems and bearings
  • Experience with programming languages capable of handling mathematical calculations
NEXT STEPS
  • Implement the relative bearing calculation in a programming language such as Python or Java
  • Explore advanced algorithms for motion analysis in 3D environments
  • Research coordinate transformation techniques for dynamic object tracking
  • Learn about sensor integration for real-time motion analysis
USEFUL FOR

Software developers, robotics engineers, and anyone involved in navigation systems or motion analysis applications will benefit from this discussion.

thomas576
Messages
20
Reaction score
1
im trying to write a program to determine target motion analysis, the problem I am having is determining how to get my computer to understand what side the 2 objects are on. here's an example. say I am a boat heading 300, so a little north west, and i have a contact on my right side, i need my program to be able to determine that its on my right side, so his possible bearings are 301degrees past 0 though 120 degrees which would be all on my right side. how can i write this to be solved ? with a simple if statement the numbers get skewed because my number set is restart again at 0 (301-359, 0-120). and the kicker of it is i need to be able to solve this problem when my heading is possilby 0-360 degrees...

thanks

i know i can explain this better but I am having problems understanding how to approach it myself
 
Last edited:
Mathematics news on Phys.org
Relative_bearing = Bearing - Heading;
if Relative_bearing < 0 then Relative_bearing = relative_bearing + 360;
if Relative_bearing < 180 then side = right; else side = left;
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K