- SGWayPoint first (deplon,
- deplat,
- 100);
- SGWayPoint sec (arrlon,
- arrlat,
- 100);
- first.CourseAndDistance(sec, &course, &distance);
- distance *= SG_METER_TO_NM;
- temp = sgPolarToCart3d(Point3D(deplon *
- SG_DEGREES_TO_RADIANS,
- deplat *
- SG_DEGREES_TO_RADIANS,
- 1.0));
- a[0] = temp.x();
- a[1] = temp.y();
- a[2] = temp.z();
-
- temp = sgPolarToCart3d(Point3D(arrlon *
- SG_DEGREES_TO_RADIANS,
- arrlat *
- SG_DEGREES_TO_RADIANS,
- 1.0));
- b[0] = temp.x();
- b[1] = temp.y();
- b[2] = temp.z();
- sgdNormaliseVec3(a);
- sgdNormaliseVec3(b);
- sgdVectorProductVec3(cross,b,a);
-
- angle = sgACos(sgdScalarProductVec3(a,b));