Java Reference
In-Depth Information
andarayfromthispole,calledthe polaraxis .Thepolaraxisisassumedto
lieinthepositivedirectionofthe x -axis.Apointinthepolarcoordinatesys-
temisdefinedbyitsdirectedangle(calledthevectorialangle)fromthepo-
laraxis,anditsdirecteddistancefromthepole,calledtheradiusvector.
Figure23-1 showstheelementsofthepolarandCartesiancoordinatesys-
tems.
y
P(x, y) = Cartesian form
P(r, ) = polar form
r
polar
axis
x
O
Figure 23-1 Polar and Cartesian Coordinate Systems
Engineering applications often require converting coordinate pairs be-
tween the polar and the Cartesian systems. Cartesian coordinates are
also called rectangular coordinates. The following formulas express po-
lar coordinates from the rectangular form:
The method atan2() in java.lang.Math returns the vectorial angle ex-
pressed by the first formula from the rectangular coordinates. The radius
y
x
tan
Θ=
r
=+
x
2
y
2
vector (r) can be calculated with the second formula.
The reverse process is obtaining the rectangular coordinates from the
polar form. The following formulas can be used:
xr
y = Θ
cos
sin
 
Search WWH ::




Custom Search