Re: Simple Analytic Geometry Question



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


.



Relevant Pages

  • Re: dot product
    ... didn't compare exactly, they compared nearly. ... Your second definition introduces a new ... the angle theta (or at least its ... inner product (and its offspring, ...
    (sci.math)
  • Re: Simple Analytic Geometry Question
    ... all angles are measured in the clockwise direction and are +ve. ... p dot d dot tafti at ieee dot org ... Thus, for the example in my original post, it would give the angle ... the inner product would give the angle between V1 and V5 as ...
    (sci.math)
  • Re: Simple Analytic Geometry Question
    ... all angles are measured in the clockwise direction and are +ve. ... the inner product would give the angle between V1 and V5 as ... the principal value of the asinfunction (from the Cross Product) ...
    (sci.math.num-analysis)
  • Re: Simple Analytic Geometry Question
    ... The principal value of the acosfunction (from the Inner Product) ... the angle from the inner product from there. ... Counter clockwise angle between V1 and V2: ... , and the slope angle ...
    (sci.math.num-analysis)
  • Re: Simple Analytic Geometry Question
    ... monir wrote: ... all angles are measured in the clockwise direction and are +ve. ... The difficulty with the Inner Product approach is that the principal ... the inner product would give the angle between V1 and V5 as ...
    (sci.math.num-analysis)