# How to get HeadingPitchRoll from Quaternion?

**URL:** <https://community.cesium.com/t/how-to-get-headingpitchroll-from-quaternion/19297>\
**Category:** CesiumJS\
**Created:** [June 28, 2022, 6:34am UTC](https://community.cesium.com/t/how-to-get-headingpitchroll-from-quaternion/19297 "2022-06-28T06:34:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![519646741](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/519646741/32/3476_2.png) [@519646741](https://community.cesium.com/u/519646741)\
**Post date:** [June 28, 2022, 6:34am UTC](https://community.cesium.com/t/how-to-get-headingpitchroll-from-quaternion/19297/1 "2022-06-28T06:34:10Z")

</div>

```
        const hpr = new HeadingPitchRoll(0, 0, 0);
        const orientation4 = Transforms.headingPitchRollQuaternion(origin, hpr);
        let orientation = new ConstantProperty(orientation4);
        currentFacility.orientation = orientation;
        let neworientation = HeadingPitchRoll.fromQuaternion(currentFacility.orientation.getValue(JulianDate.now()));
        console.log("--------", neworientation) // neworientation result is : HeadingPitchRoll {heading: 2.6520400758742566, pitch: -5.551115123125783e-17, roll: 0.9287258149259335}

        Why the result is not "{heading:0,pitch:0,roll:0}" ? Besause I set is (0,0,0).

```
