scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
scifir::coordinates_3d< T > Class Template Reference

Class that represents the position in 3D spaces. The space can be a length or, for the case of imaginary spaces, any custom dimension. The most interesting feature is the fact that all the coordinates systems in 3D are present at the same time, it's possible to use cartesian, cylindrical or spherical coordinates as needed for the same instance of coordinates, it's not needed to select just one of those systems. The geographical coordinates aren't yet finished. More...

#include <coordinates_3d.hpp>

Public Types

enum  type { CARTESIAN , CYLINDRICAL , SPHERICAL , GEODESIC }
 

Public Member Functions

 coordinates_3d ()
 Default constructor. Initializes x, y and z to 0, with the default dimensions.
 
 coordinates_3d (const coordinates_3d< T > &x_coordinates)
 Copy constructor. Initializes x, y and z to the x, y and z of x_coordinates.
 
 coordinates_3d (coordinates_3d< T > &&x_coordinates)
 Move constructor. Initializes x, y and z to the x, y and z of x_coordinates.
 
 coordinates_3d (const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
 
 coordinates_3d (const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
 
 coordinates_3d (const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
 
 coordinates_3d (const angle &new_latitude, const angle &new_longitude, const scalar_unit &new_altitude)
 
 coordinates_3d (coordinates_3d::type coordinates_type, const string &coord1, const string &coord2, const string &coord3)
 
 coordinates_3d (const string &init_coordinates_3d)
 Constructor. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d.
 
coordinates_3d< T > & operator= (const coordinates_3d< T > &x_coordinates)
 Copy assignment. Assigns x, y and z to the same values as the x, y and z of x_coordinates.
 
coordinates_3d< T > & operator= (coordinates_3d< T > &&x_coordinates)
 Move assignment. Assigns x, y and z moved from the x, y and z of x_coordinates.
 
coordinates_3d< T > & operator= (const string &init_coordinates_3d)
 Assignment. Assigns x, y and z to the values specified in the initialization string of coordinates_3d init_coordinates_3d.
 
T get_p () const
 Returns the value of p in cylindrical coordinates.
 
angle get_theta () const
 Returns the value of theta in cylindrical and spherical coordinates (it's the same theta).
 
T get_r () const
 Returns the value of r in spherical coordinates.
 
angle get_phi () const
 Returns the value of phi in spherical coordinates.
 
latitude get_latitude () const
 Returns the latitude in LLA geographical coordinates. In this case, coordinates_3d represents all the Earth inside an ellipsoid as in the standard WGS84.
 
longitude get_longitude () const
 Returns the longitude in LLA geographical coordinates. In this case, coordinates_3d represents all the Earth inside an ellipsoid as in the standard WGS84.
 
scalar_unit get_altitude () const
 Returns the altitude in LLA geographical coordinates. In this case, coordinates_3d represents all the Earth inside an ellipsoid as in the standard WGS84.
 
void set_position (const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
 
void set_position (const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
 
void set_position (const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
 
void set_position (const latitude &new_latitude, const longitude &new_longitude, const scalar_unit &new_altitude)
 
void rotate_in_x (const angle &x_angle)
 Rotates around the edge x the amount of the param x_angle.
 
void rotate_in_y (const angle &x_angle)
 Rotates around the edge y the amount of the param x_angle.
 
void rotate_in_z (const angle &x_angle)
 Rotates around the edge z the amount of the param x_angle.
 
void move (const displacement_3d &x_displacement)
 Moves x, y and z in the vector x_displacement given.
 
void move (const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
 
void move (const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
 
void move (const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
 
T distance_to_origin () const
 Calculates the distance to the origin.
 
string display_cartesian () const
 Displays the coordinates in cartesian coordinates.
 
string display_cylindrical () const
 Displays the coordinates in cylindrical coordinates.
 
string display_spherical () const
 Displays the coordinates in spherical coordinates.
 
string display_geographical () const
 Displays the coordinates in geographical coordinates.
 

Static Public Member Functions

static coordinates_3d< Torigin (const coordinates_3d< T > &origin, const coordinates_3d< T > &coordinates)
 

Public Attributes

T x
 The position in the edge x. The space can have dimensions of length or of any custom dimension.
 
T y
 The position in the edge y. The space can have dimensions of length or of any custom dimension.
 
T z
 The position in the edge z. The space can have dimensions of length or of any custom dimension.
 

Protected Member Functions

void initialize_from_string (string init_coordinates_3d)
 Internal function. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d.
 

Detailed Description

template<typename T = length>
class scifir::coordinates_3d< T >

Class that represents the position in 3D spaces. The space can be a length or, for the case of imaginary spaces, any custom dimension. The most interesting feature is the fact that all the coordinates systems in 3D are present at the same time, it's possible to use cartesian, cylindrical or spherical coordinates as needed for the same instance of coordinates, it's not needed to select just one of those systems. The geographical coordinates aren't yet finished.

Definition at line 129 of file coordinates_3d.hpp.

Member Enumeration Documentation

◆ type

Enumerator
CARTESIAN 
CYLINDRICAL 
SPHERICAL 
GEODESIC 

Definition at line 132 of file coordinates_3d.hpp.

Constructor & Destructor Documentation

◆ coordinates_3d() [1/9]

template<typename T = length>
coordinates_3d::coordinates_3d ( )
inline

Default constructor. Initializes x, y and z to 0, with the default dimensions.

Definition at line 134 of file coordinates_3d.hpp.

134 : x(),y(),z()
135 {}
T y
The position in the edge y. The space can have dimensions of length or of any custom dimension.
T x
The position in the edge x. The space can have dimensions of length or of any custom dimension.
T z
The position in the edge z. The space can have dimensions of length or of any custom dimension.

◆ coordinates_3d() [2/9]

template<typename T = length>
coordinates_3d::coordinates_3d ( const coordinates_3d< T > &  x_coordinates)
inline

Copy constructor. Initializes x, y and z to the x, y and z of x_coordinates.

Definition at line 137 of file coordinates_3d.hpp.

137 : x(x_coordinates.x),y(x_coordinates.y),z(x_coordinates.z)
138 {}

◆ coordinates_3d() [3/9]

template<typename T = length>
coordinates_3d::coordinates_3d ( coordinates_3d< T > &&  x_coordinates)
inline

Move constructor. Initializes x, y and z to the x, y and z of x_coordinates.

Definition at line 140 of file coordinates_3d.hpp.

140 : x(std::move(x_coordinates.x)),y(std::move(x_coordinates.y)),z(std::move(x_coordinates.z))
141 {}

◆ coordinates_3d() [4/9]

template<typename T = length>
scifir::coordinates_3d< T >::coordinates_3d ( const scalar_unit new_x,
const scalar_unit new_y,
const scalar_unit new_z 
)
inlineexplicit

Definition at line 143 of file coordinates_3d.hpp.

143 : x(new_x),y(new_y),z(new_z)
144 {}

◆ coordinates_3d() [5/9]

template<typename T = length>
scifir::coordinates_3d< T >::coordinates_3d ( const scalar_unit new_p,
const angle new_theta,
scalar_unit  new_z 
)
inlineexplicit

Definition at line 146 of file coordinates_3d.hpp.

147 {
148 set_position(new_p,new_theta,new_z);
149 }
void set_position(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)

◆ coordinates_3d() [6/9]

template<typename T = length>
scifir::coordinates_3d< T >::coordinates_3d ( const scalar_unit new_r,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 151 of file coordinates_3d.hpp.

152 {
153 set_position(new_r,new_theta,new_phi);
154 }

◆ coordinates_3d() [7/9]

template<typename T = length>
scifir::coordinates_3d< T >::coordinates_3d ( const angle new_latitude,
const angle new_longitude,
const scalar_unit new_altitude 
)
inlineexplicit

Definition at line 156 of file coordinates_3d.hpp.

157 {
158 set_position(new_latitude,new_longitude,new_altitude);
159 }
coordinates_3d()
Default constructor. Initializes x, y and z to 0, with the default dimensions.

◆ coordinates_3d() [8/9]

template<typename T = length>
scifir::coordinates_3d< T >::coordinates_3d ( coordinates_3d< T >::type  coordinates_type,
const string coord1,
const string coord2,
const string coord3 
)
inlineexplicit

Definition at line 161 of file coordinates_3d.hpp.

162 {
163 if (coordinates_type == coordinates_3d<>::CARTESIAN)
164 {
165 set_position(T(coord1),T(coord2),T(coord3));
166 }
167 else if (coordinates_type == coordinates_3d<>::CYLINDRICAL)
168 {
169 set_position(T(coord1),angle(coord2),T(coord3));
170 }
171 else if (coordinates_type == coordinates_3d<>::SPHERICAL)
172 {
173 set_position(T(coord1),angle(coord2),angle(coord3));
174 }
175 else if (coordinates_type == coordinates_3d<>::GEODESIC)
176 {
177 set_position(latitude(coord1),longitude(coord2),T(coord3));
178 }
179 }

◆ coordinates_3d() [9/9]

template<typename T = length>
coordinates_3d::coordinates_3d ( const string init_coordinates_3d)
inlineexplicit

Constructor. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d.

Definition at line 181 of file coordinates_3d.hpp.

182 {
183 initialize_from_string(init_coordinates_3d);
184 }
void initialize_from_string(string init_coordinates_3d)
Internal function. Initializes x, y and z with the initialization string of coordinates_3d init_coord...

Member Function Documentation

◆ display_cartesian()

template<typename T = length>
string coordinates_3d::display_cartesian ( ) const
inline

Displays the coordinates in cartesian coordinates.

Definition at line 337 of file coordinates_3d.hpp.

338 {
339 ostringstream out;
340 out << "(" << x << "," << y << "," << z << ")";
341 return out.str();
342 }

◆ display_cylindrical()

template<typename T = length>
string coordinates_3d::display_cylindrical ( ) const
inline

Displays the coordinates in cylindrical coordinates.

Definition at line 344 of file coordinates_3d.hpp.

345 {
346 ostringstream out;
347 out << "(" << get_p() << "," << get_theta() << "," << z << ")";
348 return out.str();
349 }
angle get_theta() const
Returns the value of theta in cylindrical and spherical coordinates (it's the same theta).
T get_p() const
Returns the value of p in cylindrical coordinates.

◆ display_geographical()

template<typename T = length>
string coordinates_3d::display_geographical ( ) const
inline

Displays the coordinates in geographical coordinates.

Definition at line 358 of file coordinates_3d.hpp.

359 {
360 ostringstream out;
361 out << "(" << get_latitude() << "," << get_longitude() << "," << get_altitude() << ")";
362 return out.str();
363 }
latitude get_latitude() const
Returns the latitude in LLA geographical coordinates. In this case, coordinates_3d represents all the...
scalar_unit get_altitude() const
Returns the altitude in LLA geographical coordinates. In this case, coordinates_3d represents all the...
longitude get_longitude() const
Returns the longitude in LLA geographical coordinates. In this case, coordinates_3d represents all th...

◆ display_spherical()

template<typename T = length>
string coordinates_3d::display_spherical ( ) const
inline

Displays the coordinates in spherical coordinates.

Definition at line 351 of file coordinates_3d.hpp.

352 {
353 ostringstream out;
354 out << "(" << get_r() << "," << get_theta() << "," << get_phi() << ")";
355 return out.str();
356 }
angle get_phi() const
Returns the value of phi in spherical coordinates.
T get_r() const
Returns the value of r in spherical coordinates.

◆ distance_to_origin()

template<typename T = length>
T coordinates_3d::distance_to_origin ( ) const
inline

Calculates the distance to the origin.

Definition at line 332 of file coordinates_3d.hpp.

333 {
334 return T(scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2) + scifir::pow(z,2)));
335 }
scalar_unit pow(const scalar_unit &x, int exponent)
Exponentiates a scalar_unit to some numeric type, the dimensions are also exponentiated.
angle sqrt(const angle &x)
Calculates the square root of the angle x and returns that new angle.
Definition angle.cpp:416

◆ get_altitude()

template<typename T = length>
scalar_unit coordinates_3d::get_altitude ( ) const
inline

Returns the altitude in LLA geographical coordinates. In this case, coordinates_3d represents all the Earth inside an ellipsoid as in the standard WGS84.

Definition at line 245 of file coordinates_3d.hpp.

246 {
247 return ECEF_to_LLA_altitude(x,y,z);
248 }
scalar_unit ECEF_to_LLA_altitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_latitude()

template<typename T = length>
angle coordinates_3d::get_latitude ( ) const
inline

Returns the latitude in LLA geographical coordinates. In this case, coordinates_3d represents all the Earth inside an ellipsoid as in the standard WGS84.

Definition at line 235 of file coordinates_3d.hpp.

236 {
237 return ECEF_to_LLA_latitude(x,y,z);
238 }
latitude ECEF_to_LLA_latitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_longitude()

template<typename T = length>
angle coordinates_3d::get_longitude ( ) const
inline

Returns the longitude in LLA geographical coordinates. In this case, coordinates_3d represents all the Earth inside an ellipsoid as in the standard WGS84.

Definition at line 240 of file coordinates_3d.hpp.

241 {
242 return ECEF_to_LLA_longitude(x,y,z);
243 }
longitude ECEF_to_LLA_longitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_p()

template<typename T = length>
T coordinates_3d::get_p ( ) const
inline

Returns the value of p in cylindrical coordinates.

Definition at line 215 of file coordinates_3d.hpp.

216 {
217 return T(scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2)));
218 }

◆ get_phi()

template<typename T = length>
angle coordinates_3d::get_phi ( ) const
inline

Returns the value of phi in spherical coordinates.

Definition at line 230 of file coordinates_3d.hpp.

231 {
232 return angle(scifir::acos_degree(float(z/scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2) + scifir::pow(z,2)))));
233 }
float acos_degree(float x)
Calculates the acos receiving x in degrees. It uses the acos() function of the standard library of C+...
Definition angle.hpp:247

◆ get_r()

template<typename T = length>
T coordinates_3d::get_r ( ) const
inline

Returns the value of r in spherical coordinates.

Definition at line 225 of file coordinates_3d.hpp.

226 {
227 return T(scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2) + scifir::pow(z,2)));
228 }

◆ get_theta()

template<typename T = length>
angle coordinates_3d::get_theta ( ) const
inline

Returns the value of theta in cylindrical and spherical coordinates (it's the same theta).

Definition at line 220 of file coordinates_3d.hpp.

221 {
222 return scifir::atan(float(y/x));
223 }
angle atan(float x)
Calculates the atan of some value x and returns the result as angle in degrees.
Definition angle.cpp:451

◆ initialize_from_string()

template<typename T = length>
void coordinates_3d::initialize_from_string ( string  init_coordinates_3d)
inlineprotected

Internal function. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d.

Definition at line 370 of file coordinates_3d.hpp.

371 {
372 vector<string> values;
373 if (init_coordinates_3d.front() == '(')
374 {
375 init_coordinates_3d.erase(0,1);
376 }
377 if (init_coordinates_3d.back() == ')')
378 {
379 init_coordinates_3d.erase(init_coordinates_3d.size()-1,1);
380 }
381 boost::split(values,init_coordinates_3d,boost::is_any_of(","));
382 if (values.size() == 3)
383 {
384 if (is_latitude(values[0]))
385 {
386 if (is_longitude(values[1]))
387 {
388 if (!is_angle(values[2]))
389 {
390 cout << "values[0]: " << values[0] << endl;
391 cout << "values[1]: " << values[1] << endl;
392 cout << "values[2]: " << values[2] << endl;
393 set_position(latitude(values[0]),longitude(values[1]),T(values[2]));
394 }
395 }
396 }
397 else
398 {
399 if (is_angle(values[1]))
400 {
401 if (is_angle(values[2]))
402 {
403 set_position(T(values[0]),angle(values[1]),angle(values[2]));
404 }
405 else
406 {
407 set_position(T(values[0]),angle(values[1]),T(values[2]));
408 }
409 }
410 else
411 {
412 if (!is_angle(values[2]))
413 {
414 set_position(T(values[0]),T(values[1]),T(values[2]));
415 }
416 }
417 }
418 }
419 }
bool is_latitude(const string &init_latitude)
Definition latitude.cpp:199
bool is_longitude(const string &init_longitude)
bool is_angle(const string &init_angle)
Checks if some string is an initialization string of an angle.
Definition angle.cpp:336

◆ move() [1/4]

template<typename T = length>
void coordinates_3d::move ( const displacement_3d x_displacement)
inline

Moves x, y and z in the vector x_displacement given.

Definition at line 303 of file coordinates_3d.hpp.

304 {
305 x += x_displacement.x_projection();
306 y += x_displacement.y_projection();
307 z += x_displacement.z_projection();
308 }

◆ move() [2/4]

template<typename T = length>
void scifir::coordinates_3d< T >::move ( const scalar_unit new_p,
const angle new_theta,
scalar_unit  new_z 
)
inline

Definition at line 317 of file coordinates_3d.hpp.

318 {
319 new_z.change_dimensions(new_p);
320 x += T(new_p * scifir::cos(new_theta));
321 y += T(new_p * scifir::sin(new_theta));
322 z += new_z;
323 }
float cos(const angle &x)
Calculates the cos of angle x. It uses the cos() function of the standard library of C++,...
Definition angle.cpp:431
float sin(const angle &x)
Calculates the sin of angle x. It uses the sin() function of the standard library of C++,...
Definition angle.cpp:426

◆ move() [3/4]

template<typename T = length>
void scifir::coordinates_3d< T >::move ( const scalar_unit new_r,
const angle new_theta,
const angle new_phi 
)
inline

Definition at line 325 of file coordinates_3d.hpp.

326 {
327 x += T(new_r * scifir::cos(new_theta) * scifir::sin(new_phi));
328 y += T(new_r * scifir::sin(new_theta) * scifir::sin(new_phi));
329 z += T(new_r * scifir::cos(new_phi));
330 }

◆ move() [4/4]

template<typename T = length>
void scifir::coordinates_3d< T >::move ( const scalar_unit new_x,
const scalar_unit new_y,
const scalar_unit new_z 
)
inline

Definition at line 310 of file coordinates_3d.hpp.

311 {
312 x += new_x;
313 y += new_y;
314 z += new_z;
315 }

◆ operator=() [1/3]

template<typename T = length>
coordinates_3d< T > & coordinates_3d::operator= ( const coordinates_3d< T > &  x_coordinates)
inline

Copy assignment. Assigns x, y and z to the same values as the x, y and z of x_coordinates.

Definition at line 186 of file coordinates_3d.hpp.

187 {
188 x = x_coordinates.x;
189 y = x_coordinates.y;
190 z = x_coordinates.z;
191 return *this;
192 }

◆ operator=() [2/3]

template<typename T = length>
coordinates_3d< T > & coordinates_3d::operator= ( const string init_coordinates_3d)
inline

Assignment. Assigns x, y and z to the values specified in the initialization string of coordinates_3d init_coordinates_3d.

Definition at line 202 of file coordinates_3d.hpp.

203 {
204 initialize_from_string(init_coordinates_3d);
205 return *this;
206 }

◆ operator=() [3/3]

template<typename T = length>
coordinates_3d< T > & coordinates_3d::operator= ( coordinates_3d< T > &&  x_coordinates)
inline

Move assignment. Assigns x, y and z moved from the x, y and z of x_coordinates.

Definition at line 194 of file coordinates_3d.hpp.

195 {
196 x = std::move(x_coordinates.x);
197 y = std::move(x_coordinates.y);
198 z = std::move(x_coordinates.z);
199 return *this;
200 }

◆ origin()

template<typename T = length>
static coordinates_3d< T > scifir::coordinates_3d< T >::origin ( const coordinates_3d< T > &  origin,
const coordinates_3d< T > &  coordinates 
)
inlinestatic

Definition at line 208 of file coordinates_3d.hpp.

209 {
210 coordinates_3d<T> new_coordinates(origin);
211 new_coordinates.move(coordinates.x,coordinates.y,coordinates.z);
212 return new_coordinates;
213 }
static coordinates_3d< T > origin(const coordinates_3d< T > &origin, const coordinates_3d< T > &coordinates)

◆ rotate_in_x()

template<typename T = length>
void coordinates_3d::rotate_in_x ( const angle x_angle)
inline

Rotates around the edge x the amount of the param x_angle.

Definition at line 279 of file coordinates_3d.hpp.

280 {
281 T y_coord = y;
282 T z_coord = z;
283 y = y_coord * scifir::cos(x_angle) - z_coord * scifir::sin(x_angle);
284 z = y_coord * scifir::sin(x_angle) + z_coord * scifir::cos(x_angle);
285 }

◆ rotate_in_y()

template<typename T = length>
void coordinates_3d::rotate_in_y ( const angle x_angle)
inline

Rotates around the edge y the amount of the param x_angle.

Definition at line 287 of file coordinates_3d.hpp.

288 {
289 T x_coord = x;
290 T z_coord = z;
291 x = x_coord * scifir::cos(x_angle) - z_coord * scifir::sin(x_angle);
292 z = x_coord * scifir::sin(x_angle) + z_coord * scifir::cos(x_angle);
293 }

◆ rotate_in_z()

template<typename T = length>
void coordinates_3d::rotate_in_z ( const angle x_angle)
inline

Rotates around the edge z the amount of the param x_angle.

Definition at line 295 of file coordinates_3d.hpp.

296 {
297 T x_coord = x;
298 T y_coord = y;
299 x = x_coord * scifir::cos(x_angle) - y_coord * scifir::sin(x_angle);
300 y = x_coord * scifir::sin(x_angle) + y_coord * scifir::cos(x_angle);
301 }

◆ set_position() [1/4]

template<typename T = length>
void scifir::coordinates_3d< T >::set_position ( const latitude new_latitude,
const longitude new_longitude,
const scalar_unit new_altitude 
)
inline

Definition at line 272 of file coordinates_3d.hpp.

273 {
274 x = LLA_to_ECEF_x(new_latitude,new_longitude,new_altitude);
275 y = LLA_to_ECEF_y(new_latitude,new_longitude,new_altitude);
276 z = LLA_to_ECEF_z(new_latitude,new_longitude,new_altitude);
277 }
scalar_unit LLA_to_ECEF_x(const latitude &latitude, const longitude &longitude, scalar_unit altitude)
scalar_unit LLA_to_ECEF_z(const latitude &latitude, const longitude &longitude, scalar_unit altitude)
scalar_unit LLA_to_ECEF_y(const latitude &latitude, const longitude &longitude, scalar_unit altitude)

◆ set_position() [2/4]

template<typename T = length>
void scifir::coordinates_3d< T >::set_position ( const scalar_unit new_p,
const angle new_theta,
scalar_unit  new_z 
)
inline

Definition at line 257 of file coordinates_3d.hpp.

258 {
259 new_z.change_dimensions(new_p);
260 x = T(new_p * scifir::cos(new_theta));
261 y = T(new_p * scifir::sin(new_theta));
262 z = new_z;
263 }

◆ set_position() [3/4]

template<typename T = length>
void scifir::coordinates_3d< T >::set_position ( const scalar_unit new_r,
const angle new_theta,
const angle new_phi 
)
inline

Definition at line 265 of file coordinates_3d.hpp.

266 {
267 x = T(new_r * scifir::cos(new_theta) * scifir::sin(new_phi));
268 y = T(new_r * scifir::sin(new_theta) * scifir::sin(new_phi));
269 z = T(new_r * scifir::cos(new_phi));
270 }

◆ set_position() [4/4]

template<typename T = length>
void scifir::coordinates_3d< T >::set_position ( const scalar_unit new_x,
const scalar_unit new_y,
const scalar_unit new_z 
)
inline

Definition at line 250 of file coordinates_3d.hpp.

251 {
252 x = new_x;
253 y = new_y;
254 z = new_z;
255 }

Member Data Documentation

◆ x

template<typename T = length>
T coordinates_3d::x

The position in the edge x. The space can have dimensions of length or of any custom dimension.

Definition at line 365 of file coordinates_3d.hpp.

◆ y

template<typename T = length>
T coordinates_3d::y

The position in the edge y. The space can have dimensions of length or of any custom dimension.

Definition at line 366 of file coordinates_3d.hpp.

◆ z

template<typename T = length>
T coordinates_3d::z

The position in the edge z. The space can have dimensions of length or of any custom dimension.

Definition at line 367 of file coordinates_3d.hpp.


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