summaryrefslogtreecommitdiffstats
path: root/tksao/util
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-01-27 20:45:16 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-01-27 20:45:16 (GMT)
commit52e575ab6fce2a7d56e6975ac68d9eb1b39b6e07 (patch)
tree1e74b01616c570093c9488971977c74b36297997 /tksao/util
parent64961df6408bc78c4194825c1a65c8aab360e0ab (diff)
downloadblt-52e575ab6fce2a7d56e6975ac68d9eb1b39b6e07.zip
blt-52e575ab6fce2a7d56e6975ac68d9eb1b39b6e07.tar.gz
blt-52e575ab6fce2a7d56e6975ac68d9eb1b39b6e07.tar.bz2
redefine radToDeg
Diffstat (limited to 'tksao/util')
-rw-r--r--tksao/util/util.C25
-rw-r--r--tksao/util/util.h2
2 files changed, 21 insertions, 6 deletions
diff --git a/tksao/util/util.C b/tksao/util/util.C
index 4770774..4bb2811 100644
--- a/tksao/util/util.C
+++ b/tksao/util/util.C
@@ -159,6 +159,22 @@ double zero360(double aa)
return rr;
}
+Vector zero360(const Vector& vv)
+{
+ Vector out = vv;
+ // we want the first coord to be 0-360
+ out[0] = zero360(out[0]);
+ return out;
+}
+
+Vector3d zero360(const Vector3d& vv)
+{
+ Vector out = vv;
+ // we want the first coord to be 0-360
+ out[0] = zero360(out[0]);
+ return out;
+}
+
double m180To180(double aa)
{
if (isnan(aa) || isinf(aa) || (aa == -DBL_MAX) || (aa == DBL_MAX))
@@ -173,15 +189,13 @@ double m180To180(double aa)
double radToDeg(double aa)
{
- double dd = 180.*aa/M_PI;
- return zero360(dd);
+ return 180.*aa/M_PI;
}
Vector radToDeg(const Vector& vv)
{
Vector out = vv;
- // we want the first coord to be 0-360
- out[0] = radToDeg(out[0]);
+ out[0] *= 180./M_PI;
out[1] *= 180./M_PI;
return out;
}
@@ -189,8 +203,7 @@ Vector radToDeg(const Vector& vv)
Vector3d radToDeg(const Vector3d& vv)
{
Vector3d out = vv;
- // we want the first coord to be 0-360
- out[0] = radToDeg(out[0]);
+ out[0] *= 180./M_PI;
out[1] *= 180./M_PI;
return out;
}
diff --git a/tksao/util/util.h b/tksao/util/util.h
index 5af2ee4..90e5d2d 100644
--- a/tksao/util/util.h
+++ b/tksao/util/util.h
@@ -94,10 +94,12 @@ extern double degToRad(double);
extern double radToDeg(double);
extern Vector zeroTWOPI(const Vector&);
+extern Vector zero360(const Vector&);
extern Vector degToRad(const Vector&);
extern Vector radToDeg(const Vector&);
extern Vector3d zeroTWOPI(const Vector3d&);
+extern Vector3d zero360(const Vector3d&);
extern Vector3d degToRad(const Vector3d&);
extern Vector3d radToDeg(const Vector3d&);