Re: Simple Analytic Geometry Question
- From: monir <monirg@xxxxxxxxxxxx>
- Date: Fri, 27 Jul 2007 07:35:49 -0700
On Jul 25, 12:58 pm, Lou Pecora <pec...@xxxxxxxxxxxxxxxxxx> wrote:
In article <1185376659.905092.30...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
monir <mon...@xxxxxxxxxxxx> wrote:
When I was a kid my parents moved a lot, but I always found them.
(R.Dangerfield)- Hide quoted text -
- Show quoted text -
Lou;
OK ... but how ??
The principal value of the acos() function (from the Inner Product)
is: 0.0 =< acos <= pi, and
the principal value of the asin() function (from the Cross Product)
is: -pi/2 =< asin <= pi/2.
We're looking for the CLOCKWISE angle 0.0 to 2pi between vectors
V1=a1.i+b1.j and Vn=an.i+bn.j, n=2,3,4,5
Would you be kind enough to elaborate a little bit ??
Thank you.
Monir
Here are two possibilities. Define V1perp as the clockwise pi/2
rotation of V1= (V1y, -V1x) (I think that's right, check it to make
sure). Then look at the projection of Vi (i=2,3,...) onto V1perp and the
sign of that will tell you which "side" of V1 Vi is on. You can adjust
the angle from the inner product from there.
Alternately, you might examine the rotation matrix in 2D and see which
angle is needed to move you (clockwise) from V1 to Vi (meaning vectors
parallel to them). I suspect you will get the same formulas as you
would with other methods.
Go give them a try.
--
-- Lou Pecora
When I was a kid my parents moved a lot, but I always found them.
(R.Dangerfield)- Hide quoted text -
- Show quoted text -
Hi Lou;
Thanks again, and will try your idea (with some adjustments).
For those who might encounter the same difficulty, my earlier
suggestion of using the vector inner product together with the vector
slope m* appears to be working fine for all the test cases so far!!
{ In a Rectangular Coordinate System in a plane, with X is taken as
+ve to the right and Y is taken
as +ve above the X-axis:
Clockwise angle between V1=a1.i+b1.j and V2=a2.i+b2.j:
If abs(m2) < abs(m1) then "correct theta" = 2pi - "theta inner
product".
Counter clockwise angle between V1 and V2:
If abs(m2) > abs(m1) then "correct theta" = 2pi - "theta inner
product"
With V1 extending from C(d,g) to P1(x1,y1): slop m1 of CP1= (y1-g)/
(x1-d), and the slope angle
measured counter clockwise from +ve X: (in fortran) alfa = atan2(y1-
g,x1-d) or
(in VBA) alfa = atan2(x1-d,y1-g), -pi < alfa =< +pi }
Regards.
Monir
.
- Follow-Ups:
- Re: Simple Analytic Geometry Question
- From: monir
- Re: Simple Analytic Geometry Question
- References:
- Simple Analytic Geometry Question
- From: monir
- Re: Simple Analytic Geometry Question
- From: Lou Pecora
- Re: Simple Analytic Geometry Question
- From: monir
- Re: Simple Analytic Geometry Question
- From: Lou Pecora
- Re: Simple Analytic Geometry Question
- From: monir
- Re: Simple Analytic Geometry Question
- From: Lou Pecora
- Simple Analytic Geometry Question
- Prev by Date: Re: On Counting Irrational Numbers
- Next by Date: Re: Anonymous quotation
- Previous by thread: Re: Simple Analytic Geometry Question
- Next by thread: Re: Simple Analytic Geometry Question
- Index(es):
Relevant Pages
|
|