clan::LineSegment3x< Type > Class Template Reference - ClanLib SDK
Description: clan::LineSegment3x< Type > Class Template Reference

Public Member Functions | Public Attributes | List of all members
clan::LineSegment3x< Type > Class Template Reference
clanCore Math

3D line segment More...

`#include <line_segment.h>`

## Public Member Functions
| LineSegment3x ()
| LineSegment3x (const LineSegment3x< Type > &copy)=default
| LineSegment3x (const Vec3< Type > &point_p, const Vec3< Type > &point_q)
Vec3< Type > | get_midpoint () const
| Get the midpoint of this line.
bool | operator!= (const LineSegment3x< Type > &line) const
| != operator.
LineSegment3x< Type > & | operator= (const LineSegment3x< Type > &copy)=default
| = operator.
bool | operator== (const LineSegment3x< Type > &line) const
| == operator.
Type | point_distance (const Vec3< Type > &point, Vec3< Type > &dest_intercept) const
| Calculate the distance from a line segment to a point.

## Public Attributes
Vec3< Type > | p
| Start point on the line.
Vec3< Type > | q

## Detailed Description

template<typename Type>
class clan::LineSegment3x< Type >

3D line segment

A line segment has a start point and an end point
These line templates are defined for: int (LineSegment3), float (LineSegment3f), double (LineSegment3d)

## Constructor & Destructor Documentation

## ◆ LineSegment3x() [1/3]

template<typename Type>

clan::LineSegment3x< Type >::LineSegment3x | ( |  | ) |
| inline

References p, and q.

Referenced by LineSegment3x(), operator!=(), operator=(), and operator==().

## ◆ LineSegment3x() [2/3]

template<typename Type>

clan::LineSegment3x< Type >::LineSegment3x | ( | const LineSegment3x< Type > & | copy | ) |
| default

References LineSegment3x().

## ◆ LineSegment3x() [3/3]

template<typename Type>

clan::LineSegment3x< Type >::LineSegment3x | ( | const Vec3< Type > & | point_p,
|  | const Vec3< Type > & | point_q )
| inline

References p, and q.

## Member Function Documentation

## ◆ get_midpoint()

template<typename Type>

Vec3< Type > clan::LineSegment3x< Type >::get_midpoint | ( |  | ) | const
| inline

Get the midpoint of this line.

Returns
  The midpoint

References p, and q.

## ◆ operator!=()

template<typename Type>

bool clan::LineSegment3x< Type >::operator!= | ( | const LineSegment3x< Type > & | line | ) | const
| inline

!= operator.

References LineSegment3x(), clan::line, p, and q.

## ◆ operator=()

template<typename Type>

LineSegment3x< Type > & clan::LineSegment3x< Type >::operator= | ( | const LineSegment3x< Type > & | copy | ) |
| default

= operator.

References LineSegment3x().

## ◆ operator==()

template<typename Type>

bool clan::LineSegment3x< Type >::operator== | ( | const LineSegment3x< Type > & | line | ) | const
| inline

== operator.

References LineSegment3x(), clan::line, p, and q.

## ◆ point_distance()

template<typename Type>

Type clan::LineSegment3x< Type >::point_distance | ( | const Vec3< Type > & | point,
|  | Vec3< Type > & | dest_intercept ) const

Calculate the distance from a line segment to a point.

Parameters

  point | = The point
  dest_intercept | = On Return: The point on the line closest to the point

Returns
  The Distance

## Member Data Documentation

## ◆ p

template<typename Type>

Vec3<Type> clan::LineSegment3x< Type >::p

Start point on the line.

Referenced by LineSegment3x(), LineSegment3x(), get_midpoint(), operator!=(), and operator==().

## ◆ q

template<typename Type>

Vec3<Type> clan::LineSegment3x< Type >::q

Referenced by LineSegment3x(), LineSegment3x(), get_midpoint(), operator!=(), and operator==().

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

- line_segment.h