Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Re: Help Me ! » angle from point to directed line segment » 2012-08-17 17:42:12

Hey Bob, you're the man.. seriously!

I haven't had a chance to test this out yet, but you are still the man.

Thanks
Ronny

#2 Re: Help Me ! » angle from point to directed line segment » 2012-08-16 13:23:25

Hi Bob

Many thanks once again for your ideas.

The background is that I'm writing some software that needs this result. So I think your idea of first testing which quadrant the line segment is in, and modifying the result could work. Might be easier than finding an ideal formula that works in every case.

I'll let you know how it goes.

Cheers
Ronny

#3 Re: Help Me ! » angle from point to directed line segment » 2012-08-15 18:56:13

Thanks Bob, that is so kind of you to give such a detailed explanation, but I am having some trouble.
I’m assuming:
That if my line segment is from

to

And my point is at

Then




So if

and
and

Then

is (1 + -1) = 0, which gives an angle of 90.

Good.

But if the line segment is going in the opposite direction, ie it still starts at

but ends at
,
is now (-1 + 1) and still is 0.

And I get an angle of 90, when I was hoping for 270.

Any clues?

Thanks once again for your assistance.

Cheers
Ronny

#4 Re: Help Me ! » angle from point to directed line segment » 2012-08-13 19:31:10

Thanks Bob for the detailed explanation, but I’m not sure if it gives me what I want, as I don’t think it takes the directed nature of the line segment into account.

Let me know if I’ve gotten this wrong:

But if the line segment starts at (2, 2) and ends at (1, 1) the slope is 1.

If it starts at (2, 2) and ends at (3, 3) the slope is also 1. The slope is the same, and therefore the end angle is the same, but I want a different answer.

Not sure if this is pushing the friendship, but what is the scalar product solution, and would that help with the directed line segment?

Much appreciated!

Cheers
Ronny

#5 Re: Help Me ! » angle from point to directed line segment » 2012-08-13 17:09:30

Thanks Bob for your time and the explanation. I hope you weren't too distracted whilst trimming your hedges and that they look ok.

I will give it a whirl and post my result.

And yes, the original post was the same - no spam, no advertisements, no bad jokes.

Cheers
Ronny

#6 Help Me ! » angle from point to directed line segment » 2012-08-13 00:30:48

ronzul
Replies: 11

Apologies if you have already replied to this.. I posted this earlier but somehow it was deleted (as was my newly created account!!). I hope I didn't offend the powers that be with my question yikes

I have a directed line segment and a point, and I need to determine the angle of intersection between:
1.    The line from the point to the start of the directed line segment
2.    The directed line segment

For example if the directed line segment is from (2, 2) to (1, 1), and I have a point at (3, 1), then the angle would be 90 degrees. But from the point (1, 3) the angle would 270 degrees.

And if the segment was from (2, 2) to (3, 3), then from (3, 1) the angle would be 270 degrees, and from (1, 3) it would be 90 degrees

This is probably a one off question, so just the formula would be more than appreciated.. although if you don’t know the answer, any tips would be good as well.

Many thanks

Board footer

Powered by FluxBB