Stellarator-Tools
coordinate_utilities Module Reference

Module is part of the LIBSTELL. This modules containes code to convert from different coordinate systems. More...

Functions/Subroutines

pure real(rprec) function, dimension(3), public cart_to_cyl (cart)
 Convert a point from cartes cartesian coordinates to cylindical coordinates. More...
 
pure real(rprec) function, dimension(3), public cyl_to_cart (cyl)
 Convert a point from cylindical coordinates to cartesian coordinates. More...
 
pure real(rprec) function, dimension(3), public cyl_to_cart_vec (cyl, vec)
 Convert vector from cylindical coordinates to cartesian coordinates. More...
 
pure real(rprec) function, dimension(3) cart_to_cyl_vec (cart, vec)
 Convert vector from cartesian coordinates to cylindical coordinates. More...
 
logical function, public cood_utils_test ()
 Coordinate utilities unit test function. More...
 

Detailed Description

Module is part of the LIBSTELL. This modules containes code to convert from different coordinate systems.

Function/Subroutine Documentation

◆ cart_to_cyl()

pure real (rprec) function, dimension(3), public coordinate_utilities::cart_to_cyl ( real (rprec), dimension(3), intent(in)  cart)

Convert a point from cartes cartesian coordinates to cylindical coordinates.

r = Sqrt(x*x + y*y) phi = atan(y/x) z = z

Parameters
[in]cartPoint in cartesian coordinates.
Returns
The point in cyclindical coordinates.

◆ cart_to_cyl_vec()

pure real (rprec) function, dimension(3) coordinate_utilities::cart_to_cyl_vec ( real (rprec), dimension(3), intent(in)  cart,
real (rprec), dimension(3), intent(in)  vec 
)

Convert vector from cartesian coordinates to cylindical coordinates.

[ v_r ] [ x/r y/r 0 ] [ v_x ] [ v_phi ] = [ -y/r x/r 0 ] * [ v_y ] [ v_z ] [ 0 0 1 ] [ v_z ]

Where r = Sqrt(x*x + y*y)

Note
Phi must be in radians.
Parameters
[in]cartPoint in cartesian coordinates.
[in]vecPoint in cartesian coordinates.
Returns
The point in cylindical coordinates.

◆ cood_utils_test()

logical function, public coordinate_utilities::cood_utils_test

Coordinate utilities unit test function.

This runs the associated unit tests and returns the result.

Returns
True if the tests pass and false otherwise.

◆ cyl_to_cart()

pure real (rprec) function, dimension(3), public coordinate_utilities::cyl_to_cart ( real (rprec), dimension(3), intent(in)  cyl)

Convert a point from cylindical coordinates to cartesian coordinates.

x = r*cos(phi) y = r*sin(phi) z = z

Note
Phi must be in radians.
Parameters
[in]cylPoint in cylindical coordinates.
Returns
The point in cartesian coordinates.

◆ cyl_to_cart_vec()

pure real (rprec) function, dimension(3), public coordinate_utilities::cyl_to_cart_vec ( real (rprec), dimension(3), intent(in)  cyl,
real (rprec), dimension(3), intent(in)  vec 
)

Convert vector from cylindical coordinates to cartesian coordinates.

[ v_x ] [ cos[phi] -sin[phi] 0 ] [ v_r ] [ v_y ] = [ sin[phi] cos[phi] 0 ] * [ v_phi ] [ v_z ] [ 0 0 1 ] [ v_z ]

Note
Phi must be in radians.
Parameters
[in]cylPoint in cylindical coordinates.
[in]vecVector in cylindical coordinates.
Returns
The point in cartesian coordinates.