1
0
Fork 0

Tweaks ...

This commit is contained in:
curt 2001-01-31 23:04:52 +00:00
parent d48a506721
commit 0fd3e83b12

View file

@ -28,18 +28,25 @@ int main() {
Point3D pc = sgGeodToCart( pgd ); Point3D pc = sgGeodToCart( pgd );
cout << " cartesian = " << pc << endl; cout << " cartesian = " << pc << endl;
sgMat4 UP; sgMat4 GEOD_UP;
sgVec3 geod_up; sgVec3 geod_up;
sgMakeRotMat4( UP, lon, 0.0, -lat ); sgMakeRotMat4( GEOD_UP, lon, 0.0, -lat );
sgSetVec3( geod_up, UP[0][0], UP[0][1], UP[0][2] ); sgSetVec3( geod_up, GEOD_UP[0][0], GEOD_UP[0][1], GEOD_UP[0][2] );
cout << " geod up = " << geod_up[0] << ", " << geod_up[1] << ", " cout << " geod up = " << geod_up[0] << ", " << geod_up[1] << ", "
<< geod_up[2] << endl; << geod_up[2] << endl;
sgMat4 GEOC_UP;
sgVec3 geoc_up;
sgMakeRotMat4( GEOC_UP, lon, 0.0, -lat_geoc * RAD_TO_DEG );
sgSetVec3( geoc_up, GEOC_UP[0][0], GEOC_UP[0][1], GEOC_UP[0][2] );
cout << " geoc up = " << geoc_up[0] << ", " << geoc_up[1] << ", "
<< geoc_up[2] << endl;
double slope = geod_up[2] / geod_up[0]; double slope = geod_up[2] / geod_up[0];
double intercept = pc.z() - slope * pc.x(); double intercept = pc.z() - slope * pc.x();
cout << " Z intercept (based on geodetic up) = " << intercept << endl; cout << " Z intercept (based on geodetic up) = " << intercept << endl;
slope = pc.z() / pc.x(); slope = geoc_up[2] / geoc_up[0];
intercept = pc.z() - slope * pc.x(); intercept = pc.z() - slope * pc.x();
cout << " Z intercept (based on geocentric up) = " << intercept << endl; cout << " Z intercept (based on geocentric up) = " << intercept << endl;