summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-01-25 17:02:58 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-01-25 17:02:58 (GMT)
commit36744276e0ab64178e6dbdcdff27507dba4c2e43 (patch)
tree3bf092289efdf063f54dc961d10391011ba7f21c
parent3ed165e1f56ed5fe5ef47fb7f7f6195e70579ec6 (diff)
downloadblt-36744276e0ab64178e6dbdcdff27507dba4c2e43.zip
blt-36744276e0ab64178e6dbdcdff27507dba4c2e43.tar.gz
blt-36744276e0ab64178e6dbdcdff27507dba4c2e43.tar.bz2
minor
-rw-r--r--tksao/frame/fr3dmap.C15
1 files changed, 6 insertions, 9 deletions
diff --git a/tksao/frame/fr3dmap.C b/tksao/frame/fr3dmap.C
index a4465d3..53fc2c8 100644
--- a/tksao/frame/fr3dmap.C
+++ b/tksao/frame/fr3dmap.C
@@ -69,15 +69,12 @@ Vector3d Frame3dBase::mapToRef3d(const Vector& vv, Coord::InternalSystem sys,
// note: sl is in REF=DATA coordinates
Vector3d xx = Vector3d(1,0,sl)*refToWidget3d;
Vector3d yy = Vector3d(0,1,sl)*refToWidget3d;
- Vector3d zz = Vector3d(0,0,sl)*refToWidget3d;
+ Vector3d oo = Vector3d(0,0,sl)*refToWidget3d;
- Vector3d ii=xx-zz;
- Vector3d jj=yy-zz;
+ Vector3d ii=xx-oo;
+ Vector3d jj=yy-oo;
Vector3d nn = cross(jj,ii).normalize();
- double a = nn[0];
- double b = nn[1];
- double c = nn[2];
- double d = -a*xx[0] -b*xx[1] -c*xx[2];
+ double dd = -(nn*xx);
Vector ww;
switch (sys) {
@@ -101,7 +98,7 @@ Vector3d Frame3dBase::mapToRef3d(const Vector& vv, Coord::InternalSystem sys,
break;
}
- double z = (-a*ww[0] -b*ww[1] -d)/c;
- return Vector3d(ww,z)*widgetToRef3d;
+ double zz = (-nn[0]*ww[0]-nn[1]*ww[1]-dd) / nn[2];
+ return Vector3d(ww,zz)*widgetToRef3d;
}