a*sin(theta)+b a*cos(theta) + e -------------- = ---------------- c*sin(theta)+d c*cos(theta) + f solved for theta by Scott Datallo's magic gives: theta = arcsin(-C * cos(gamma)) - gamma where C = (de-bf)/(ec-af) and gamma = arctan( (ad-bc)/(ec-af) ) Scott, you nailed it! It took me a bit to figure out a couple of your steps, but then I remembered my sum-of-angles formulae and off I went. Did you do this by hand or use some tool? What prompted the brilliant substitution of tan(gamma) = (ad-bc)/(ec-af) ?? I am in awe! Bob Ammerman RAm Systems ----- Original Message ----- From: "Scott Dattalo" To: "Microcontroller discussion list - Public." Sent: Friday, April 01, 2005 4:27 PM Subject: Re: [EE] Math formula help. > Bob Ammerman wrote: > >>> you will note of course this is the same as: >>> >>> >>> where x = sin(theta) (and 'theta' is indeed an angle in the range >>> [0..2pi) radians > > Bob, > > If you cross multiply and collect terms you get: > > tan(gamma) * cos(theta) + sin(theta) + C = 0 > > Where > > tan(gamma) = (ad-bc)/(ec-af) > C = (de-bf)/(ec-af) > > This can be simplified to: > > sin(theta + gamma) = -C * cos(gamma) > > and solved for theta: > > theta = arcsin(-C * cos(gamma)) - gamma > > of course, > > gamma = arctan( (ad-bc)/(ec-af) ) > > Scott > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist