# Question about drawing an ellipse and about cartesian3 angles

**URL:** <https://community.cesium.com/t/question-about-drawing-an-ellipse-and-about-cartesian3-angles/881>\
**Category:** CesiumJS\
**Created:** [December 18, 2013, 8:12pm UTC](https://community.cesium.com/t/question-about-drawing-an-ellipse-and-about-cartesian3-angles/881 "2013-12-18T20:12:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkos200](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@dkos200](https://community.cesium.com/u/dkos200)\
**Post date:** [December 18, 2013, 8:12pm UTC](https://community.cesium.com/t/question-about-drawing-an-ellipse-and-about-cartesian3-angles/881/1 "2013-12-18T20:12:00Z")

</div>

Question 1:

In Cesium.Shapes there is a static function named "computeEllipseBoundary". One of the params it takes is "rotation". I understand what this value is, but I'm not sure how to get it without hard-coding.

I want the rotation value to change depending on where my mouse is at a given time. For example, if my mouse is at a 45 degree angle on the 3D globe, I want to know that. I'm trying to constantly re-draw an ellipse until I release the left click on the mouse, so I need my params to constantly update until I'm finished drawing the ellipse.

Question 2:

In Cesium.Cartesian3 there is a static function named "angleBetween". The documentation says it returns "the angle between the Cartesians". What does that mean? What angle? I was hoping it would return a value I could use as the "rotation" in my first question, but it doesn't look like that is what it's trying to do.

Any help on either question is much appreciated!

---

<div class="post-metadata">

**Author:** ![Scott\_Reynolds](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_reynolds/32/2014_2.png) [@Scott\_Reynolds](https://community.cesium.com/u/Scott_Reynolds)\
**Post date:** [December 19, 2013, 4:12pm UTC](https://community.cesium.com/t/question-about-drawing-an-ellipse-and-about-cartesian3-angles/881/2 "2013-12-19T16:12:23Z")

</div>

In Cesium an ellipse is drawn along a line of longitude that passes through the center point.  
Noting that positive x points East and positive y points North you can do something like this which is a modification of the Ellipse example in SandCastle.

```
// Green ellipse with height
// Default orientation of ellipse is along north/south
// Remember that positive x is East and positive y is North
var north = Cesium.Cartesian3.fromArray([0.0, 1.0, 0.0]);
var mouse = Cesium.Cartesian3.fromArray([1.0, 1.0, 0.0]);
var rotationAngle = Cesium.Cartesian3.angleBetween(north, mouse);

ellipseGeometry = new Cesium.EllipseGeometry({
    center : ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-95.0, 35.0)),
    semiMinorAxis : 200000.0,
    semiMajorAxis : 400000.0,
    rotation : rotationAngle,
    height: 200000.0,
    vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
});
```
