STIR  6.2.0
Files | Functions
Items related to simple geometric calculations
Collaboration diagram for Items related to simple geometric calculations:

Files

file  line_distances.h
 A few functions to compute distances between lines etc.
 

Functions

template<class coordT >
coordT stir::coordinate_between_2_lines (CartesianCoordinate3D< coordT > &result, const LORAs2Points< coordT > &line0, const LORAs2Points< coordT > &line1)
 find a point half-way between 2 lines and their distance More...
 
template<class coordT >
coordT stir::distance_between_line_and_point (const LORAs2Points< coordT > &line, const CartesianCoordinate3D< coordT > &r1)
 find the distance between a point and a line
 
template<class coordT >
void stir::project_point_on_a_line (const CartesianCoordinate3D< coordT > &p1, const CartesianCoordinate3D< coordT > &p2, CartesianCoordinate3D< coordT > &r1)
 Project a point on a line. More...
 

Detailed Description

Functions to compute distances between lines etc.

Function Documentation

◆ coordinate_between_2_lines()

template<class coordT >
coordT stir::coordinate_between_2_lines ( CartesianCoordinate3D< coordT > &  result,
const LORAs2Points< coordT > &  line0,
const LORAs2Points< coordT > &  line1 
)
inline

find a point half-way between 2 lines and their distance

The point is found by minimising the distance with both lines.

If the lines are parallel, the point returned is still valid, although it is of course not unique in practice.

References stir::inner_product(), and stir::square().

◆ project_point_on_a_line()

template<class coordT >
void stir::project_point_on_a_line ( const CartesianCoordinate3D< coordT > &  p1,
const CartesianCoordinate3D< coordT > &  p2,
CartesianCoordinate3D< coordT > &  r1 
)
inline

Project a point on a line.

Author
Nikos Efthimiou

References stir::inner_product().