Bill Allombert on Sun, 20 Jul 2025 10:32:01 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: question on wedge products and rationals in n-Euclidean space rotation


On Sat, Jul 19, 2025 at 09:12:51PM -0700, American Citizen wrote:
> Hello all:
> 
> I work with lots of rational points on surfaces (2d and 3d and occasionally
> higher) but I am trying to work out a rational rotator.
> 
> Please let me explain.
> 
> > dot(a,b)=sum(i=1,#a,a[i]*b[i]);

dot(a,b) = a*b~

> > wedge(a,b)=(a~*b)-(b~*a);
> > mag(a)=rsqrt(dot(a,a));
> > 
> > \\ rotate a --> b --> Rotator in n-space
> > mat_rot(a,b)=dot(a,b)-wedge(a,b);
> I am trying to rotate a point "pt" by using the two vectors a,b which create
> the wedge product
> > na=a/mag(a);
> > ab=(a+b)/2;
> > ab/=mag(ab);
> > AB=mat_rot(na,ab);
> > BA=mat_rot(ab,na);
> The ab vector is 1/2 the way between the two input vectors, a and b, and is
> needed to do the 1/2 the rotation angle since a reflection is being used.
> For example, if I want to rotate 90 degs, I'd have to put in two vectors,
> say in 3d [1,0,0] and [1,1,0] to indicate 45 degrees rotation in the xy
> plane. But the [1,1,0] vector has to be normalized, or the end results don't
> come out right.
> 
> We used the wedge products as kind of a sandwich product, which is commonly
> written a^(-1) * V * a
> 
> new_pt = (BA*pt~)~*AB))
> 
> The problem is the line "ab/=mag(ab). I found out by playing around that the
> two vectors have to be normalized, ie. a/mag(a) and (ab)/mag(ab) for the
> wedge product to work correctly. But that line introduces square roots and
> so the result comes out in real decimals, not as rationals or integers.

mat_rot is homogenous of degree 1 with respect to each of the variable so
mat_rot(a/mag(a),b/mag(b))= mat_rot(a,b)/(mag(a)*mag(b)) 
                          = mat_rot(a,b)/rsqrt(dot(a,a)*dot(b,b))

So if dot(a,a)*dot(b,b) is a square, you can stay with rational numbers.

Cheers,
Bill.