]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCProjection.cxx
Alex Romosan:
[flightgear.git] / src / ATC / ATCProjection.cxx
index 2db8598fe938ca916741a3efb2b1fe0afa549d8b..5c7ed78c6b24b51d8d40bea97fe8cdad05f63932 100644 (file)
@@ -37,7 +37,7 @@ FGATCProjection::FGATCProjection() {
     correction_factor = cos(origin.lat() * DCL_DEGREES_TO_RADIANS);
 }
 
-FGATCProjection::FGATCProjection(Point3D centre) {
+FGATCProjection::FGATCProjection(const Point3D& centre) {
     origin = centre;
     correction_factor = cos(origin.lat() * DCL_DEGREES_TO_RADIANS);
 }
@@ -45,12 +45,12 @@ FGATCProjection::FGATCProjection(Point3D centre) {
 FGATCProjection::~FGATCProjection() {
 }
 
-void FGATCProjection::Init(Point3D centre) {
+void FGATCProjection::Init(const Point3D& centre) {
     origin = centre;
     correction_factor = cos(origin.lat() * DCL_DEGREES_TO_RADIANS);
 }
 
-Point3D FGATCProjection::ConvertToLocal(Point3D pt) {
+Point3D FGATCProjection::ConvertToLocal(const Point3D& pt) {
     double delta_lat = pt.lat() - origin.lat();
     double delta_lon = pt.lon() - origin.lon();
 
@@ -60,7 +60,7 @@ Point3D FGATCProjection::ConvertToLocal(Point3D pt) {
     return(Point3D(x,y,0.0));
 }
 
-Point3D FGATCProjection::ConvertFromLocal(Point3D pt) {
+Point3D FGATCProjection::ConvertFromLocal(const Point3D& pt) {
        double delta_lat = asin(pt.y() / SG_EQUATORIAL_RADIUS_M) * DCL_RADIANS_TO_DEGREES;
        double delta_lon = (asin(pt.x() / SG_EQUATORIAL_RADIUS_M) * DCL_RADIANS_TO_DEGREES) / correction_factor;
        
@@ -79,13 +79,13 @@ FGATCAlignedProjection::FGATCAlignedProjection() {
 FGATCAlignedProjection::~FGATCAlignedProjection() {
 }
 
-void FGATCAlignedProjection::Init(Point3D centre, double heading) {
+void FGATCAlignedProjection::Init(const Point3D& centre, double heading) {
     origin = centre;
     theta = heading * DCL_DEGREES_TO_RADIANS;
     correction_factor = cos(origin.lat() * DCL_DEGREES_TO_RADIANS);
 }
 
-Point3D FGATCAlignedProjection::ConvertToLocal(Point3D pt) {
+Point3D FGATCAlignedProjection::ConvertToLocal(const Point3D& pt) {
     // convert from lat/lon to orthogonal
     double delta_lat = pt.lat() - origin.lat();
     double delta_lon = pt.lon() - origin.lon();
@@ -100,7 +100,7 @@ Point3D FGATCAlignedProjection::ConvertToLocal(Point3D pt) {
     return(Point3D(x,y,pt.elev()));
 }
 
-Point3D FGATCAlignedProjection::ConvertFromLocal(Point3D pt) {
+Point3D FGATCAlignedProjection::ConvertFromLocal(const Point3D& pt) {
        //cout << "theta = " << theta << '\n';
        //cout << "origin = " << origin << '\n';
     // de-align