Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have vectors on a canvas which display a heading.
I also calculated the current heading with which the user is moving his mouse.
When he moves over vectors, i only want to select those that match the heading of the users mouse movements.
e.g. consider vector 1 has 180 degree heading
the user moves his mouse and has an approx heading of 170.
Since the user cannot exactly match the vectors heading, i want to add a margin.
E.g. is heading of vector between (170 - 45) and (170 + 45) ?
The problem arises when the vector has a heading e.g. 350 and the users mouse has a heading of 10 - that would be between (10-45) and (10+45) - now obviously -35 is not good so i add 360 degrees again, in this case 325 < 350 but 350 is not > 55
I obviously need some deeper understanding how to calculate this case.
tldr:
Given degree X, how to measure if it is between degree A and B if you imagine a circle.
Use the difference. Subtract the actual heading from your desired heading. While the answer is <=-180 or >180, add or subtract 360 as appropriate. Then compare the result to your error band (in your example >-45, <45)
Instead of comparing angles I would compare the dot product of the vectors. If a vector has components v=[vx,vy] and I want to compare it to the mouse direction m=[mx,my] then I calculate the following
t = ACOS( (mx*vx+my*vy)/(SQRT(mx^2+my^2)*SQRT(vx^2+vy^2)) )
Then check if the angle t in radians is within the tolerance you want. For example with 6° the code is
IF t<=6*(π/180) THEN ...
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have bumped into the following statement in an Engineering journal. The statement is mentioned on right side example.
A 640x480 image with a horizontal FOV of 47 degrees gives focal length
f = 740 pixels.
Please let me know the calculations behind this as I am very new to Computer vision.
AFAIU 740 is not the exact answer for such data but close enough. According to my understanding
f = (width/2) * ctg(HFOV/2)
which give me f = 735.95. And to reverse for f = 740 the HFOV should be 46.77°.
The math behind is following: assume that on their Figure 2 Y1 is actually the top point on the sensor (I'll use vertical field of view here instead of horizontal because it allows me to use that image). Now consider the triangle O-P-Y1. In that triangle ∠P is half of the FOV. On the other hand ctg(∠P) = ctg(FOV/2) is OP/OY1 which is f/(height/2).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I have a camera I'd like to mount on a tripod. I know the FOV dimensions of the camera (22.5 deg V 31 deg H). I'd like to know at what height and what tilt angle to place the camera to be able to capture the two points of interest on the ground. Please see the figure below.
I have attempted a solution using basic trig but am not sure it is correct. Please help!
Your calculations are correct in my view.
If you have to include both the red points, you need to place your camera at an angle such that it encloses both the red points.
So, tan θ = d/hc
=> θ = tan -1 d/hc.
But, as you need to enclose both the points, your angle should be slightly greater than θ ( my suggestion --- some θ+ε, where 0.25 < ε < 1 ) to perfectly capture those 2 red dots.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I would realize the papercraft of a geodesic sphere like THIS .
Is the dual of the one discussed in THIS OTHER QUESTION .
Where can I find the printable nets, or the online resources to create them?
In the other discussion I learned that there are 3 classes of possible tessellations.
One of these classes needs less pentagons to tessellate the sphere?
I don't exactly know how much faces I need, indicatively between 100 and 200.
Which chord factors I should consider?
Thanks to all
genna,
The link that I provided in the former discussion...
http://thomson.phy.syr.edu/thomsonapplet.php
...provides for display of a dual. Unfortunately, the java applet will only export a data set for the geodesic triangular tessellation; not the dual.
The dual can be constructed from the triangular tessellation, by importing the vertex (point) data set (from the java applet) into a 3D-graphics program, and then following the rules of the definition of a dual. (Each pent/hex face will use the triangular vertex point as the centerpoint of a circle, being equidistant from the sphere center and normal to the central vector. The intersections of these circles will produce the linear edges of the dual faces.)
All tessellated duals, based on the icosahedron, will have the same number of pentagonal faces (12), regardless of how many hex faces are produced.
-Taff
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I have a problem it is like trig and pre calc. We are given vector points for OA which is (6 0) and vector OB (-6 0) and OC (5 root11) and they are all points on a circle with a radius of 6. How exactly do you determine or show that these points lie on the circle?
For any three points which are not mutually co-linear, there is a point equidistant from each member of the set. Finding this point given three arbitrary points (and not given the radius) is a much more informative project if you're learning trigonometry.
In your example, the solution is simple: x2 + y2 = r2. Each of the points you provided have values such that the sum of their squares equals 36, as expected for a circle of radius 6. Your problem is especially easy because the circle in question is already centered on the origin.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Does anyone know the equation to get the current x position and the current y position of a projectile with gravity and mass figured in? The object is fired horizontally from a given height h, with initial velocity v.
The trajectory will be a parabola. If you're fire the projectile horizontally (i.e. in positive x direction) at height y0, then you're entering the parabola at its vertex, for which I'll use coordinates (x0, y0). Ignoring friction, the horizontal component of your velocity will always equal the initial velocity, whereas the vertical velocity will increrase linearily with time. Intergrating that gives you the position for a given time t as:
x = x0 + vt
y = y0 − gt2/2
In the second equation, g denotes the gravitational acceleration of 9.81 m/s2. Unless you consider friction, the mass of the object has no impact at all, as the higher gravitational force is compensated by the greater inertia. The equations obviously assume that positive y is up, and the gravity pulls down.