As I mentioned earlier, you might try a sin & cos comparison, which will also give you the quadrant information you need. To elaborate on that, doing an arcsin will give you two possible angles. Doing an arccos will give you two possible angles, one of which will be identical to the output from the arcsin, and is the angle you are looking for. You will then need to do some quadrant arithmetic. I'm sure you're already aware that the usual azimuth convention sets 0 at north which is a 90 degree offset from the usual math convention, and that the azimuth angles increase in the opposite direction from the usual math convention. Don't you need a third sensor to derive the dip of the field (tip angle)? Jim Barry Gershenfeld wrote: > You want the arctangent. That's tangent in, angle out. And you Mark Peterson wrote: > I'm working on a compass project where I have two magneto resistive sensors > connected to a couple PIC analog inputs. This effectively generates a sin > and cos value for the angle of the magnetic field. What is the trig, > CORDIC, or whatever function that I need to use to turn the sin and cos > value into a single angle value? > > Thanks. > > Mark P > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu