Re: Angle of bot in relation to peg
Not sure exactly what you are looking for, if you are looking for the angle to the peg this is my best answer.
If you have used the target's height to computer distance to the target and are looking at the target mostly head on, you should begin by setting up a triangle with the target of width W as one side and the camera as the corner opposite that side. The angle between the two sides that enter the camera corner is known to you, and can be computed, we can call it A. Draw the distance to the target(D) as a line from the midpoint of the width side to camera corner. You are looking for the angle between this line and the side of length W, we'll call this angle theta, which is our goal.
Setup three equations, using the Law of Cosines for each of the three triangles you have made. Though we don't know the lengths of the two outside legs of the largest triangle, we don't need to. You should have three equations three unknowns. Solve for theta, eliminating the two leg lengths.
The result I get is:
theta=ACOS(SQRT([(D/W)+(W/(4D))]^2[{(D/W)(W/(4D))}/cos(A)]^2))
As to which side of the peg you are on, GeeToo has a good point, with targets this year the closer one will be bigger.
