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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# Line Class Reference

This reference page is linked to from the following overview topics: Math and Geometry Utilities.

Search for all occurrences

## Detailed Description

Represents a line segment in 3d space.

Definition at line 1478 of file math.h.

`#include <math.h>`

List of all members.

## Public Types
enum | IntersectionResult { PARALLEL, COINCIDENT, NOT_INTERSECTING, INTERSECTING }
| Possible return values of computing intersection of 2 lines. More...
## Public Member Functions
| Line (const Vector &vStart, const Vector &vEnd)
| Constructor, based on start and end points.
float | RangeFrom (const Vector &vPoint)
| Returns the shortest distance between a given point and this line.
IntersectionResult | Intersection2D (const Line &cOther, Vector &vResult, bool bSegmentOnly=false)
| Calculates intersection of 2 lines in 2D.

## Member Enumeration Documentation

enum IntersectionResult

Search for all occurrences

Possible return values of computing intersection of 2 lines.

Enumerator:

  PARALLEL | Search for all occurrences
  COINCIDENT | Search for all occurrences
  NOT_INTERSECTING | Search for all occurrences
  INTERSECTING | Search for all occurrences

Definition at line 1499 of file math.h.

        {
            PARALLEL,
            COINCIDENT,
            NOT_INTERSECTING,
            INTERSECTING
        };

## Constructor & Destructor Documentation

Line | ( | const Vector & | vStart,
|  | const Vector & | vEnd
| ) |  |

Constructor, based on start and end points.

## Member Function Documentation

float RangeFrom | ( | const Vector & | vPoint | ) |

Search for all occurrences

Returns the shortest distance between a given point and this line.

Note: The line is not logically extended to infinity in this function. Only points between the start and end point are considered part of the line.

IntersectionResult Intersection2D | ( | const Line & | cOther,
|  | Vector & | vResult,
|  | bool | bSegmentOnly = `false`
| ) |  |

Search for all occurrences

Calculates intersection of 2 lines in 2D.

If bSegmentOnly is true it will only result the intersection point if it is between the segment endpoints, otherwise the result apply to whole lines.

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

- Mudbox/math.h

Line Line Line Line Line Line Line Line Line Line
Line Line Line Line Line Line Line Line Line Line