Table Of Contents

sphere_to_cart

Version:
    Last Modified: December 12, 2016

    Converts spherical data into 3D Cartesian data. This function works element-wise for arrays.

    Syntax

    [x, y, z] = sphere_to_cart(a, b, c)
    Legacy name: sph2cart

    Inputs

    a

    Azimuthal angles or the angles measured from the x-axis to the data points projected in the xy-plane. a is a scalar or an array of any dimension of floating-point or real numbers.

    b

    Elevation angles or the angles measured from the xy-plane to the data points. b is a scalar or an array of any dimension of floating-point or real numbers of the same shape as a.

    c

    Radii. c is a scalar or an array of any dimension of floating-point or real numbers of the same shape as a.

    Outputs

    x

    X-coordinates. x is an array of the same size as the maximum shape of a, b, and c.

    y

    Y-coordinates. y is an array of the same size as the maximum shape of a, b, and c.

    z

    Z-coordinates. z is an array of the same size as the maximum shape of a, b, and c.

    Calculation of a, b, and c

    MathScript computes a, b, and c using the following equations:

    x = c.*cos(a).*cos(b)

    y = c.*sin(a).*cos(b)

    z = c.*sin(b)

    [X, Y, Z] = sphere_to_cart(1, 1, 1)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: DAQExpress does not support FPGA devices


    Recently Viewed Topics