How Can I Program Target Motion Analysis Considering 360 Degrees?

  • Thread starter Thread starter thomas576
  • Start date Start date
  • Tags Tags
    Trig
AI Thread Summary
The discussion focuses on programming target motion analysis to determine the relative position of objects based on a boat's heading. The main challenge is calculating whether an object is on the right or left side of the boat when the heading ranges from 0 to 360 degrees. The proposed solution involves using relative bearing calculations, adjusting for negative values by adding 360 degrees. The logic indicates that if the relative bearing is less than 180 degrees, the object is on the right side; otherwise, it is on the left. This approach aims to accurately assess object positions regardless of the boat's heading.
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;
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Back
Top