cart_to_sphere (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

»查看产品信息 下载帮助（仅限Windows）

Owning Class: basic

Requires: MathScript RT Module

Syntax

[a, b, c] = cart_to_sphere(x, y, z)

Legacy Name: cart2sph

Description

Transforms 3D Cartesian coordinates into spherical data. This function works element-wise for matrices.

Details

Examples

Inputs

Name Description
x Specifies the x-coordinates. x is a matrix.
y Specifies the y-coordinates. y is a matrix of the same size as x.
z Specifies the z-coordinates. z is a matrix of the same size as x.

Outputs

Name Description
a Returns the azimuthal angles, or the angles measured from the x-axis to the data points projected in the xy-plane. a is a matrix of the same size as x.
b Returns the elevation angles, or the angles measured from the xy-plane to the data points. b is a matrix of the same size as x.
c Returns the radii of the spherical data. c is a matrix of the same size as x.

Details

LabVIEW performs the transformation using the following equations:
a = atan2(y, x)
b = atan2(z, sqrt(x.^2+y.^2))
c = sqrt(x.^2+y.^2+z.^2)

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

Examples

[A, B, C] = cart_to_sphere(1, 1, 1)

﻿