EllipseCurve - Verge3D User Manual - Soft8Soft
Description: Learn how to use EllipseCurve in your interactive 3D apps made with Verge3D

Curve →

# EllipseCurve

Creates a 2D curve in the shape of an ellipse. Setting the xRadius equal to the yRadius will result in a circle.

## Code Example

`const curve = new v3d.EllipseCurve( 0, 0, // ax, aY 10, 10, // xRadius, yRadius 0, 2 * Math.PI, // aStartAngle, aEndAngle false, // aClockwise 0 // aRotation ); const points = curve.getPoints(50); const geometry = new v3d.BufferGeometry().setFromPoints(points); const material = new v3d.LineBasicMaterial({ color: 0xff0000 }); // create the final object to add to the scene const ellipse = new v3d.Line(geometry, material); app.scene.add(ellipse);`

## Constructor

### EllipseCurve(aX : Float, aY : Float, xRadius : Float, yRadius : Float, aStartAngle : Float, aEndAngle : Float, aClockwise : Boolean, aRotation : Float)

- aX – the X center of the ellipse. Default is `0`.
- aY – the Y center of the ellipse. Default is `0`.
- xRadius – the radius of the ellipse in the x direction. Default is `1`.
- yRadius – the radius of the ellipse in the y direction. Default is `1`.
- aStartAngle – the start angle of the curve in radians starting from the positive X axis. Default is `0`.
- aEndAngle – the end angle of the curve in radians starting from the positive X axis. Default is `2 x Math.PI`.
- aClockwise – whether the ellipse is drawn clockwise. Default is `false`.
- aRotation – the rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is `0`.

## Properties

See the base Curve class for common properties.

### # .aX : Float

The X center of the ellipse.

### # .aY : Float

The Y center of the ellipse.

### # .xRadius : Float

The radius of the ellipse in the X direction.

### # .yRadius : Float

The radius of the ellipse in the Y direction.

### # .aStartAngle : Float

The start angle of the curve in radians starting from the middle right side.

### # .aEndAngle : Float

The end angle of the curve in radians starting from the middle right side.

### # .aClockwise : Boolean

Whether the ellipse is drawn clockwise.

### # .aRotation : Float

The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is `0`.

## Methods

See the base Curve class for common methods.

## Source

For more info on how to obtain the source code of this module see this page.