| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csDSquaredDist Class Reference
[Geometry utilities]

Some functions to perform squared distance calculations. More...

`#include <csgeom/math3d_d.h>`

List of all members.

## Static Public Member Functions
static double | PointLine (const csDVector3 &p, const csDVector3 &l1, const csDVector3 &l2)
| Returns the squared distance between a point and a line.
static double | PointPlane (const csDVector3 &p, const csDPlane &plane)
| Returns the squared distance between a point and a normalized plane.
static double | PointPoint (const csDVector3 &p1, const csDVector3 &p2)
| Returns the squared distance between two points.
static double | PointPoly (const csDVector3 &p, csDVector3 *V, int n, const csDPlane &plane, double sqdist=-1)
| Returns the squared distance between a point and a polygon.

## Detailed Description

Some functions to perform squared distance calculations.

This is a static class and contains only static member functions.

Definition at line 569 of file math3d_d.h.

## Member Function Documentation

static double csDSquaredDist::PointLine | ( | const csDVector3 & | p,
|  | const csDVector3 & | l1,
|  | const csDVector3 & | l2 |
| ) |  |  | `[static]`

Returns the squared distance between a point and a line.

static double csDSquaredDist::PointPlane | ( | const csDVector3 & | p,
|  | const csDPlane & | plane |
| ) |  |  | `[inline, static]`

Returns the squared distance between a point and a normalized plane.

Definition at line 581 of file math3d_d.h.

References csDPlane::Classify().

static double csDSquaredDist::PointPoint | ( | const csDVector3 & | p1,
|  | const csDVector3 & | p2 |
| ) |  |  | `[inline, static]`

Returns the squared distance between two points.

Definition at line 573 of file math3d_d.h.

References dSqr(), csDVector3::x, csDVector3::y, and csDVector3::z.

static double csDSquaredDist::PointPoly | ( | const csDVector3 & | p,
|  | csDVector3 * | V,
|  | int | n,
|  | const csDPlane & | plane,
|  | double | sqdist = `-1` |
| ) |  |  | `[static]`

Returns the squared distance between a point and a polygon.

If sqdist is >= 0, then it is used as the pre-calculated point to plane distance. V is an array of vertices, n is the number of vertices, and plane is the polygon plane.

The documentation for this class was generated from the following file:

- csgeom/math3d_d.h