Qdos
ON LINE REFERENCE
Classes - Functions - Home - Structure

template<class T1, class T2> rp_deg_to_xy<T1,T2> Function Reference

Transforms polar coordinates (r, (p)hi) to two-dimensional Cartesian, or xy, coordinates. Details...

#include <CoordSys.h>

Prototype


Details

rp_deg_to_xy obtains the two-dimensional Cartesian, or xy, coordinates from polar coordinates (r, (p)hi ), where:-

See also: rp_to_xy, xy_to_rp_deg.

Examples: test_coordrep_trans.cc


Function Documentation

template <class T1, class T2> void rp_deg_to_xy( const T1& rp_in, T2& xy_out)

Transforms polar coordinates (r, (p)hi) to two-dimensional Cartesian, or xy, coordinates.
rp_in is an indexable class where

Similarly,

Calculates xy_out as:-

 xy_out[0]=rp_in[0]*cos(rp_in[1]);
 xy_out[1]=rp_in[0]*sin(rp_in[1]);

template <class T1, class T2> void rp_deg_to_xy( const T1& r_in, const T1& phi_in,T2& x_out,T2& y_out)

As above but with the exception that the individual coordinates are passed as separate arguments, rather than as indexable classes.

template <class T1, class T2> void rp_deg_to_xy( const T1& rp_in, T2& xy_out)

const version of rp_deg_to_xy with indexable-class arguments. This version is instantiated when xy_out is the result of an operation passed-by-value (e.g. the result of a Matrix<T> index operation.) In these cases, xy_out acts as a handle on the actual data storage area - xy_out cannot itself be modified, but the data it refers to can be.

template <class T1, class T2> void rp_deg_to_xy( const T1& r_in, const T1& phi_in, const T2& x_out, const T2& y_out)

const version of rp_deg_to_xy with individual coordinates being passed as the arguments. This version is instantiated when x_out and y_out are both the results of operations passed-by-value.

Requirements on types

For all versions, In the first and third versions:- For the second and fourth const versions:-

Preconditions

In the first and third versions,


Copyright © 2000 QMW Space Plasma Group QMW Space Plasma Group Home Page
Qdos 2000