OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | List of all members
ossimplugins::RectangularCoordinate Class Reference

This class represents a coordinate in a rectangular reference. More...

#include <RectangularCoordinate.h>

Inheritance diagram for ossimplugins::RectangularCoordinate:
ossimplugins::Coordinate

Public Member Functions

 RectangularCoordinate ()
 Constructor. More...
 
 ~RectangularCoordinate ()
 Destructor. More...
 
 RectangularCoordinate (double x, double y, double z)
 Cosntructor with initializations. More...
 
 RectangularCoordinate (const RectangularCoordinate &rhs)
 Copy constructor. More...
 
RectangularCoordinateoperator= (const RectangularCoordinate &rhs)
 Affectation operator. More...
 
void AsGeodesicCoordinates (double demiGdAxe, double demiPtAxe, GeodesicCoordinate *geod)
 
- Public Member Functions inherited from ossimplugins::Coordinate
 Coordinate ()
 Constructor. More...
 
 ~Coordinate ()
 Destructor. More...
 
 Coordinate (double x, double y, double z)
 Constructor with initializations. More...
 
 Coordinate (const Coordinate &rhs)
 Copy constructor. More...
 
Coordinateoperator= (const Coordinate &rhs)
 Affectation operator. More...
 
void set_coordinates (double x, double y, double z)
 
double get_x ()
 
double get_y ()
 
double get_z ()
 

Additional Inherited Members

- Protected Attributes inherited from ossimplugins::Coordinate
double _x
 
double _y
 
double _z
 

Detailed Description

This class represents a coordinate in a rectangular reference.

Definition at line 27 of file RectangularCoordinate.h.

Constructor & Destructor Documentation

◆ RectangularCoordinate() [1/3]

ossimplugins::RectangularCoordinate::RectangularCoordinate ( )

Constructor.

Definition at line 21 of file RectangularCoordinate.cpp.

22 {
23 }

◆ ~RectangularCoordinate()

ossimplugins::RectangularCoordinate::~RectangularCoordinate ( )

Destructor.

Definition at line 25 of file RectangularCoordinate.cpp.

26 {
27 }

◆ RectangularCoordinate() [2/3]

ossimplugins::RectangularCoordinate::RectangularCoordinate ( double  x,
double  y,
double  z 
)

Cosntructor with initializations.

Definition at line 29 of file RectangularCoordinate.cpp.

29  : Coordinate(x,y,z)
30 {
31 }
ossim_uint32 x
ossim_uint32 y
Coordinate()
Constructor.
Definition: Coordinate.cpp:20

◆ RectangularCoordinate() [3/3]

ossimplugins::RectangularCoordinate::RectangularCoordinate ( const RectangularCoordinate rhs)

Copy constructor.

Definition at line 33 of file RectangularCoordinate.cpp.

33  : Coordinate((Coordinate)rhs)
34 {
35 }
Coordinate()
Constructor.
Definition: Coordinate.cpp:20

Member Function Documentation

◆ AsGeodesicCoordinates()

void ossimplugins::RectangularCoordinate::AsGeodesicCoordinates ( double  demiGdAxe,
double  demiPtAxe,
GeodesicCoordinate geod 
)

Definition at line 46 of file RectangularCoordinate.cpp.

References ossimplugins::Coordinate::_x, ossimplugins::Coordinate::_y, ossimplugins::Coordinate::_z, PI, and ossimplugins::Coordinate::set_coordinates().

Referenced by ossimplugins::SarSensor::ImageToWorld().

47 {
48  const double PI = 3.14159265358979323846 ;
49  const int itmax = 40 ;
50  const double epsilon = 1.0e-6 ;
51 
52  int fin , iter ;
53  double u, a2_b2, d, e, f, df, c, s, p, q ;
54 
55  double coordCart[3];
56  double coordGeod[3];
57 
58  coordCart[0] = _x;
59  coordCart[1] = _y;
60  coordCart[2] = _z;
61 
62  u = sqrt (coordCart[0] * coordCart[0] + coordCart[1] * coordCart[1]) ;
63  if (u < epsilon)
64  {
65  coordGeod[0] = 0.0 ;
66  if (coordCart[2] >= 0.0)
67  coordGeod[1] = PI / 2.0 ;
68  else
69  coordGeod[1] = - PI / 2.0 ;
70  coordGeod[2] = fabs (coordCart[2]) - demiPtAxe ;
71  }
72  else
73  {
74  coordGeod[0] = atan2 (coordCart[1] , coordCart[0]) ;
75  a2_b2 = demiGdAxe * demiGdAxe - demiPtAxe * demiPtAxe ;
76  e = atan (coordCart[2] / u) ;
77  fin = 0 ;
78  iter = 0 ;
79  while (fin == 0)
80  {
81  iter++ ;
82  d = e ;
83  c = cos (e) ;
84  s = sin (e) ;
85  p = demiGdAxe * u ;
86  q = demiPtAxe * coordCart[2] ;
87  f = p * s - q * c - a2_b2 * s * c ;
88  df = p * c + q * s - a2_b2 * (c * c - s * s) ;
89  e = e - f / df ;
90  d = fabs (e - d) ;
91  if ((d < epsilon) || (iter >= itmax))
92  fin = 1 ;
93  }
94  coordGeod[1] = atan (tan (e) * demiGdAxe / demiPtAxe) ;
95 
96  p = cos(coordGeod[1]) ;
97 
98  if (fabs(coordGeod[1]) <= (PI * 0.5))
99  coordGeod[2] = (u - demiGdAxe * cos(e)) / cos(coordGeod[1]) ;
100  else
101  coordGeod[2] = (coordCart[2] - demiPtAxe * sin(e)) / sin(coordGeod[1]) ;
102 
103  geod->set_coordinates(coordGeod[0],coordGeod[1], coordGeod[2]);
104  }
105  //return 0 ;
106 }
#define PI
Definition: ossimGeoref.cpp:88

◆ operator=()

RectangularCoordinate & ossimplugins::RectangularCoordinate::operator= ( const RectangularCoordinate rhs)

Affectation operator.

Definition at line 37 of file RectangularCoordinate.cpp.

References ossimplugins::Coordinate::_x, ossimplugins::Coordinate::_y, and ossimplugins::Coordinate::_z.

38 {
39  _x = rhs._x;
40  _y = rhs._x;
41  _z = rhs._x;
42 
43  return *this;
44 }

The documentation for this class was generated from the following files: