Where can you find the right tools in the LuciadLightspeed API to perform fairly common geometric calculations?

## How can you perform geometric calculations in LuciadLightspeed?

LuciadLightspeed allows you to perform several geometric calculations. For example, you can:

• Calculate the length of a geodesic line defined by two points

• Calculate the azimuth of a rhumbline defined by two points

• Calculate the geodesic area of a polygon

• Determine if there is an overlap between two shapes

To perform those types of operations in LuciadLightspeed, you simply have to call the right methods. Here’s where to look for them across the LuciadLightspeed API.

## Common geometry calculations in the Geodesy package

The LuciadLightspeed API contains the package `com.luciad.geodesy`. This package offers classes that perform many common geometric calculations.

### `ILcdEllipsoid`

`ILcdEllipsoid` is an interface that defines an ellipsoid in LuciadLightspeed. It also defines a bunch of utility methods for performing geometric calculations. `ILcdEllipsoid` is sufficient to perform most of the basic calculations:

• `geodesicDistance()` to return the shortest distance between two points on an ellipsoid

• `forwardAzimuth2D()` to return the azimuth direction of the geodesic line from two points

• `geodesicPointSFCT()` to return the geodesic coordinate of a point with a certain direction and distance

• `geodesicArea()` to return the geodesic area of a polygon

• `intersects2DLS()` to determine if two lines intersect

There are also a few methods to perform calculations with rhumblines, such as `rhumblineDistance()`, `rhumblineAzimuth2D()` and `rhumblinePointSFCT()`.

There is a default `ILcdEllipsoid` implementation called `TLcdEllipsoid`. To retrieve an instance of `ILcdEllipsoid`, call `getEllipsoid()` from an instance of `ILcdGeodeticDatum`.

 If you are looking for Cartesian equivalents of these geodetic calculations, try the `TLcdCartesian` utility class in the `com.luciad.geometry` package.

### Geodesy utility classes

If you need more than the functionality provided by `ILcdEllipsoid`, check the utility classes in the `geodesy` package: