docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SphericalToCartesian

    SphericalToCartesian(float, float, float)

    Converts spherical coordinates to cartesian coordinates.

    Declaration
    public static Vector3 SphericalToCartesian(float azRad, float elevRad, float r)
    Parameters
    Type Name Description
    float azRad

    The azimuth angle, in radians. 0 corresonds to the Z+ axis (forward).

    float elevRad

    The elevation angle, in radians. 0 corresonds to the XZ plane (floor).

    float r

    The radial distance, in meters.

    Returns
    Type Description
    Vector3

    The cartesian coordinates, in meters.

    Remarks

    Positive values of azimuth turn clockwise, from Z+ to X+ Positive values of elevation are above the floor, towards Y+.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)