# How to get Cartesian3Velocity back out?

**URL:** https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452
**Category:** CesiumJS
**Created:** [April 27, 2020, 10:27pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452 "2020-04-27T22:27:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![J2Disco](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/j2disco/32/2192_2.png) [@J2Disco](https://community.cesium.com/u/J2Disco)
#### Post date: [April 27, 2020, 10:27pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452/1 "2020-04-27T22:27:06Z")

</div>

I have a CZML Data source with cartesianVelocities in it–how can I access the dX, dY, dZ values…?

---

<div class="post-metadata">

### Author: ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)
#### Post date: [April 28, 2020, 3:34pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452/2 "2020-04-28T15:34:30Z")

</div>

You should be able to get the entity by ID, then access its properties. Everything in the CZML API should be mirrored in the Entity API.

There’s an example of retrieving an entity from a loaded CZML here: [https://sandcastle.cesium.com/index.html?src=Multi-part%20CZML.html](https://sandcastle.cesium.com/index.html?src=Multi-part%20CZML.html)

```auto
viewer.trackedEntity = vehicleEntity = dataSource.entities.getById('Vehicle');

```

---

<div class="post-metadata">

### Author: ![J2Disco](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/j2disco/32/2192_2.png) [@J2Disco](https://community.cesium.com/u/J2Disco)
#### Post date: [April 28, 2020, 3:48pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452/3 "2020-04-28T15:48:09Z")

</div>

My issue though isn’t finding the entity, but on getting the velocity data out of a SampledPositionProperty: Seemingly with .getValue you can only get back the  
position given a time, but I don’t see any way of getting the derivatives of a property…

![image001.jpg](https://global.discourse-cdn.com/cesium/original/2X/2/2485d26919316b1d80aa60f5ca8e2cb5bc0275fe.jpeg)

---

<div class="post-metadata">

### Author: ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)
#### Post date: [May 3, 2020, 6:08pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452/4 "2020-05-03T18:08:40Z")

</div>

The value you’re calling `.getValue()` on is itself the position property over time.

If you want to compute the velocity of this position propety, create a Velocity Property and pass that sampled position property to it: [https://cesium.com/docs/cesiumjs-ref-doc/VelocityVectorProperty.html?classFilter=Veloci](https://cesium.com/docs/cesiumjs-ref-doc/VelocityVectorProperty.html?classFilter=Veloci). This is how it’s done in this Sandcastle: [https://sandcastle.cesium.com/index.html?src=Time%20Dynamic%20Wheels.html](https://sandcastle.cesium.com/index.html?src=Time%20Dynamic%20Wheels.html)

---

<div class="post-metadata">

### Author: ![J2Disco](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/j2disco/32/2192_2.png) [@J2Disco](https://community.cesium.com/u/J2Disco)
#### Post date: [May 4, 2020, 4:49pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452/5 "2020-05-04T16:49:33Z")

</div>

That’s what I ended up doing, though from a memory standpoint having the data be in there twice doesn’t seem ideal–as it’s storing the derivatives values in position.\_property.\_values, there’s just seemingly no API way to get them back out. ☹

---

<div class="post-metadata">

### Author: ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)
#### Post date: [May 5, 2020, 2:11pm UTC](https://community.cesium.com/t/how-to-get-cartesian3velocity-back-out/9452/6 "2020-05-05T14:11:28Z")

</div>

I think it just uses a reference, so no data is duplicated.
