1

I am currently trying to find the intersections points of two rotated polynomial 2nd degree (so also called parabolic). I am able to calculate the intersection points with no rotations, but not with one.

My current code is based on Code or formula for intersection of two parabolas in any rotation

syms t1 t2 
% a1 b1 c1 are coefficients of the first polynomial
% a2 b2 c2 of the second one

% First polynomial equation
fax = a1*t1.^2 + b1*t1 + c1;
fay = t1;

fax1 = fax*cos(w1) - sin(w1)*fay;
fay1 = +fax*sin(w1) + cos(w1)*fay;

% Second polynomial equation
fbx = a2*t2.^2 + b2*t2+ c2;
fby = t2;

fbx1 = fbx*cos(w2) - sin(w2)*fby;
fby1 = fbx*sin(w2) + cos(w2)*fby;

[solT1 solT2]  = solve([fbx1-fax1,fby1-fay1],[t1 t2],'MaxDegree', 4);

double(solT1)
double(solT2)

But the solve function does not return equal values for x/y equations. Can somebody help me, where do I have my failure?

Output:

>> double(solT1)
ans =
          -35970.3949972882 +                     0i
          -547.958594347212 +                     0i
           45277.2230289302 +      73433.2725463157i
           45277.2230289302 -      73433.2725463157i
>> double(solT2)
ans =
          -43312.4016357418 +                     0i
          -123.972586439179 +                     0i
           87780.3324792941 -      89532.7369678429i
           87780.3324792941 +      89532.7369678429i
Community
  • 1
  • 1
Mr.Sheep
  • 1,368
  • 1
  • 15
  • 32

0 Answers0