point3 Derived Type

type, public :: point3


Contents


Components

TypeVisibility AttributesNameInitial
real(kind=real64), public :: x
real(kind=real64), public :: y
real(kind=real64), public :: z

Type-Bound Procedures

procedure, public :: print => point3_print_cartesian

procedure, public :: print_sph => point3_print_spherical

  • public subroutine point3_print_spherical(self)

    Print the polar coordinates of a point in this form

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self

procedure, public :: rho => point3_rho

  • public function point3_rho(self) result(rho)

    Calculate the magnitude (distance from the origin) of

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self

    Return Value real(kind=real64)

procedure, public :: theta => point3_theta

  • public function point3_theta(self) result(theta)

    Return the inlination theta

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self

    Return Value real(kind=real64)

procedure, public :: phi => point3_phi

  • public function point3_phi(self) result(phi)

    return the azimuth phi

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self

    Return Value real(kind=real64)

procedure, public :: to_array => point3_to_array

  • public function point3_to_array(self) result(array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self

    Return Value real(kind=real64), dimension(3)

procedure, public :: dist => point3_distance_between_point3

  • public function point3_distance_between_point3(self, p2) result(dist)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self
    class(point3), intent(in) :: p2

    Return Value real(kind=real64)

generic, public :: from_sph => from_sph_r32, from_sph_r64, from_sph_int

This is the comment for a generic function

  • public function point3_from_spherical_r32(rho, theta, phi) result(point)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in) :: rho
    real(kind=real32), intent(in) :: theta
    real(kind=real32), intent(in) :: phi

    Return Value type(point3)

  • public function point3_from_spherical_r64(rho, theta, phi) result(point)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in) :: rho
    real(kind=real64), intent(in) :: theta
    real(kind=real64), intent(in) :: phi

    Return Value type(point3)

  • public function point3_from_spherical_int(rho, theta, phi) result(point)

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: rho
    integer, intent(in) :: theta
    integer, intent(in) :: phi

    Return Value type(point3)

generic, public :: operator(+) => add

  • public function point3_plus_point3(self, p2) result(p3)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self
    class(point3), intent(in) :: p2

    Return Value type(point3)

generic, public :: assignment(=) => from_array_r32, from_array_r64, from_array_int

  • public subroutine point3_from_array_r32(point, array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(out) :: point
    real(kind=real32), intent(in), dimension(3):: array
  • public subroutine point3_from_array_r64(point, array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(out) :: point
    real(kind=real64), intent(in), dimension(3):: array
  • public subroutine point3_from_array_int(point, array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(out) :: point
    integer, intent(in), dimension(3):: array

generic, public :: operator(-) => subtract

  • public function point3_minus_point3(self, p2) result(p3)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self
    class(point3), intent(in) :: p2

    Return Value type(point3)

procedure, public :: add => point3_plus_point3

  • public function point3_plus_point3(self, p2) result(p3)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self
    class(point3), intent(in) :: p2

    Return Value type(point3)

procedure, public :: point3_unary_minus

  • public function point3_unary_minus(self) result(p3)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self

    Return Value type(point3)

procedure, public :: subtract => point3_minus_point3

  • public function point3_minus_point3(self, p2) result(p3)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(in) :: self
    class(point3), intent(in) :: p2

    Return Value type(point3)

procedure, public, nopass :: from_sph_r32 => point3_from_spherical_r32

  • public function point3_from_spherical_r32(rho, theta, phi) result(point)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in) :: rho
    real(kind=real32), intent(in) :: theta
    real(kind=real32), intent(in) :: phi

    Return Value type(point3)

procedure, public, nopass :: from_sph_r64 => point3_from_spherical_r64

  • public function point3_from_spherical_r64(rho, theta, phi) result(point)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in) :: rho
    real(kind=real64), intent(in) :: theta
    real(kind=real64), intent(in) :: phi

    Return Value type(point3)

procedure, public, nopass :: from_sph_int => point3_from_spherical_int

  • public function point3_from_spherical_int(rho, theta, phi) result(point)

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: rho
    integer, intent(in) :: theta
    integer, intent(in) :: phi

    Return Value type(point3)

procedure, public :: from_array_r32 => point3_from_array_r32

  • public subroutine point3_from_array_r32(point, array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(out) :: point
    real(kind=real32), intent(in), dimension(3):: array

procedure, public :: from_array_r64 => point3_from_array_r64

  • public subroutine point3_from_array_r64(point, array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(out) :: point
    real(kind=real64), intent(in), dimension(3):: array

procedure, public :: from_array_int => point3_from_array_int

  • public subroutine point3_from_array_int(point, array)

    Arguments

    Type IntentOptional AttributesName
    class(point3), intent(out) :: point
    integer, intent(in), dimension(3):: array