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

definition:

   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) February 23, 2025
Generated by manServer 1.08 from 50758abc-f831-4985-b13e-bafac5944a00 using man macros.