Documentation

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

sph2cart

Transform spherical coordinates to Cartesian

Syntax

[x,y,z] = sph2cart(azimuth,elevation,r)

Description

[x,y,z] = sph2cart(azimuth,elevation,r) transforms the corresponding elements of spherical coordinate arrays to Cartesian, or xyz, coordinates. azimuth, elevation, and r must all be the same size (or any of them can be scalar). azimuth and elevation are angular displacements in radians. azimuth is the counterclockwise angle in the x-y plane measured from the positive x-axis. elevation is the elevation angle from the x-y plane.

More About

collapse all

Algorithms

The mapping from spherical coordinates to three-dimensional Cartesian coordinates is

x = r .* cos(elevation) .* cos(azimuth)
y = r .* cos(elevation) .* sin(azimuth)
z = r .* sin(elevation)

Introduced before R2006a

Was this topic helpful?