Re: Line intersection given 2 point/angle pairs



Some people over on the ActionScript3 forum were able to help me out:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=665&threadid=1325165&CFID=11473922&CFTOKEN=38370c4ae773dc3c-FB58AEA2-BA6C-BBB9-195AD23154F870BF&jsessionid=4830d5b1270e32375c54

My final working solution was surprisingly simple:

// this function returns the slope and y-intercept of the line going
thru x,y at angle degrees (as flash measures)
function pointAngleF(point,angle) {
var m = Math.tan(Math.PI*angle/180);
var b = point.x-point.y*m;
return {m:m,b:b};
}
// this function returns the slope and y-intercept of the line going
thru x1,y1 and x2,y2
function pointPointF(p1,p2) {
var m = (p1.y-p2.y)/(p1.x-p2.x);
var b = p1.y-p1.x*m;
return {m:m,b:b};
}
// this function returns the x,y point at the intersection of lines
with slope and y-intercept m1,b1 and m2,b2.
function intersection(m1,b1,m2,b2) {
if (m1!=m2) {
var x = (b2-b1)/(m1-m2);
var y = m1*x+b1;
return {x:x,y:y};
} else {
return null;
}
}

Works perfectly!

On Dec 24, 8:05 pm, Aaron Beall <cont...@xxxxxxxxxx> wrote:
Actually, I can ensure that the angles are facing in a direction such
that they will intersect.

I should also mention that I also have 2 secondary points for both
points, so I can form a line segment for both points if that is more
convenient than an angle. These line segments may or may not contain
the intersection, both cases may occur.

On Dec 24, 7:41 pm, Aaron Beall <cont...@xxxxxxxxxx> wrote:

...as added information, the lines will never be parallel, but I won't
always know in which direction the two will intersect -- ie the known
angles may be pointing away from the intersection point.

On Dec 24, 7:36 pm, Aaron Beall <cont...@xxxxxxxxxx> wrote:

Consider the following:

http://abeall.com/files/temp/vector.intersect.gif

I have two known points, p1 and p2, and with them two known angles, a1
and a2. How would I determine p3?

I've been reading over the FAQ:http://www.faqs.org/faqs/graphics/algorithms-faq/

And really can't figure this out, any help would be appreciated.

- aaron

.



Relevant Pages

  • Re: How to prove that hyperbola and ellipse are orthogonal
    ... Well I know there are 4 points of intersection, and at these points the slope of the ellipse will be at a right angle to the slope of the hyperbola. ... I was asked to find the points of intersection in part b), so I thought I needed to proove that they are orthogonal without finding the actual points first. ...
    (sci.math)
  • Re: Determine corner-coordinate on triangle
    ... slope = 0.965688... ... The angle in your diagram should be 30 degrees, ... and then find the intersection of the two lines. ...
    (sci.math)
  • Re: An optimization problem
    ... and X have a non-trivial intersection, it's still unbounded, because you ... This shows that maximizing your quotient is essentially equivalent to ... minimizing the angle between Xp and Ad. ... least squares and p and d is to be optimized simultaneously. ...
    (sci.math)
  • Re: Panasonic Lumix DMC-LX5 announced - looks good!
    ... to see the curvature of the wall/ceiling intersection as it passes ... when I pointed out earlier in this thread that within a narrow angle ... all the perspective types look about the same? ... undisturbed compared with extreme WA rectangular-perspective ...
    (rec.photo.digital)
  • Re: Differential geometry problem
    ... where [kappas are principal curvatures and si is angle between arc ... the normal plane. ... intersection curve can stand alone in space with tau,kappa properties ... differ only by a constant in the normal plane, ...
    (sci.math)