Jim Wilson writes: > Is there a simgear or plib function that I can use to get the angle between > two locations? Namely the angle of direction from eye (lon, lat, alt) to > aircraft (target_lon, target_lat, target_alt). For example in our current > "chase view" the angle would be the "heading" since we are always following > the plane. In tower view I need to calculate the angle to the plane (which > actually will be the way all lookat views work when I am done).
There's a lot of ways to skin a cat. libGLU provides a function (and I think ssg gives you access to it) that allows you to specify the view point, the target "look at" point and an up vector. Otherwise, depending on the level of accuracy you need, have a look at simgear/math/sg_geodesy.hxx, look at the *wgs_84() functions. In simgear/math/polar3d.hxx there are functions to do the same sort of thing, but use a simpler spherical model. Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities [EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
