C Library Functions  - polar_to_cartesian (3)

NAME

polar_to_cartesian(3f) - [M_pixel:TRIGONOMETRY] convert polar coordinates to Cartesian coordinates (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Results
Examples
Author
License

SYNOPSIS

subroutine polar_to_cartesian(radius,inclination,x,y)

    real,intent(in) :: radius,inclination
    real,intent(out)  :: x,y

DESCRIPTION

Convert polar coordinate <radius, inclination > with angles in radians to cartesian point <X,Y> using the formulas

      x=radius*cos(inclination)
      y=radius*sin(inclination)

OPTIONS

RADIUS The radial distance from the origin (O) to the point (P)
INCLINATION
  The INCLINATION angle in radians between the inclination reference direction (x-axis) and the orthogonal projection of the line OP of the reference plane (x-y plane).

RESULTS

X The distance along the x-axis
Y The distance along the y-axis

EXAMPLES

examples of usage

   program demo_polar_to_cartesian
   use M_pixel, only : polar_to_cartesian
   implicit none
   real    :: x,y
   real    :: r,i
   !!integer :: ios

!!INFINITE: do !! write(*,advance=’no’)’Enter radius and inclination(in radians):’ !! read(*,*,iostat=ios) r, i !! if(ios.ne.0)exit INFINITE call polar_to_cartesian(r,i,x,y) write(*,*)’x=’,x,’ y=’,y,’radius=’,r,’inclination=’,i !!enddo INFINITE end program demo_polar_to_cartesian

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 polar_to_cartesian (3) July 22, 2023
Generated by manServer 1.08 from 9f4058d2-c52e-4c5f-b2d8-73e7cea1a1dc using man macros.