lines_meet_algorithm Class Reference

#include <lines_meet_algorithm.hpp>

Inheritance diagram for lines_meet_algorithm:

point_algorithm algorithm observer subject List of all members.

Public Member Functions

 lines_meet_algorithm (boost::shared_ptr< geo_line > l, boost::shared_ptr< geo_line > m)
virtual ~lines_meet_algorithm (void)

Protected Member Functions

virtual point calculate ()
 Calculates the intersection of two lines. The following formula is used:

\begin{eqnarray} y & = & m_1*x + t_1 \\ y & = & m_2*x + t_2 \end{eqnarray}

\begin{eqnarray*} m_1*x + t_1 & = & m_2*x + t_2 \\ m_1*x - m_2*x & = & t_2 - t_1 \\ x & = & \frac{t_2 - t_1}{m_1 - m_2} \end{eqnarray*}

\begin{eqnarray*} y & = & m_1*\frac{t_2 - t_1}{m_1 - m_2} + t_1 \\ y & = & \frac{m_1*t_2 - m_1*t_1}{m_1 - m_2} + \frac{t_1*m_1 - t_1*m_2}{m_1 - m_2} \\ y & = & \frac{m_1*t_2 - m_1*t_1 + t_1*m_1 - t_1*m_2}{m_1 - m_2} \\ y & = & \frac{m_1*t_2 - t_1*m_2}{m_1-m_2} \end{eqnarray*}

.


Private Attributes

boost::shared_ptr< geo_linem_l
boost::shared_ptr< geo_linem_m

Detailed Description

Definition at line 30 of file lines_meet_algorithm.hpp.


Constructor & Destructor Documentation

lines_meet_algorithm::lines_meet_algorithm boost::shared_ptr< geo_line l,
boost::shared_ptr< geo_line m
 

Definition at line 23 of file lines_meet_algorithm.cpp.

References m_l, and m_m.

lines_meet_algorithm::~lines_meet_algorithm void   )  [virtual]
 

Definition at line 30 of file lines_meet_algorithm.cpp.

References m_l, and m_m.


Member Function Documentation

point lines_meet_algorithm::calculate  )  [protected, virtual]
 

Calculates the intersection of two lines. The following formula is used:

\begin{eqnarray} y & = & m_1*x + t_1 \\ y & = & m_2*x + t_2 \end{eqnarray}

\begin{eqnarray*} m_1*x + t_1 & = & m_2*x + t_2 \\ m_1*x - m_2*x & = & t_2 - t_1 \\ x & = & \frac{t_2 - t_1}{m_1 - m_2} \end{eqnarray*}

\begin{eqnarray*} y & = & m_1*\frac{t_2 - t_1}{m_1 - m_2} + t_1 \\ y & = & \frac{m_1*t_2 - m_1*t_1}{m_1 - m_2} + \frac{t_1*m_1 - t_1*m_2}{m_1 - m_2} \\ y & = & \frac{m_1*t_2 - m_1*t_1 + t_1*m_1 - t_1*m_2}{m_1 - m_2} \\ y & = & \frac{m_1*t_2 - t_1*m_2}{m_1-m_2} \end{eqnarray*}

.

Implements point_algorithm.

Definition at line 56 of file lines_meet_algorithm.cpp.

References m_l, and m_m.


Member Data Documentation

boost::shared_ptr<geo_line> lines_meet_algorithm::m_l [private]
 

Definition at line 33 of file lines_meet_algorithm.hpp.

Referenced by calculate(), lines_meet_algorithm(), and ~lines_meet_algorithm().

boost::shared_ptr<geo_line> lines_meet_algorithm::m_m [private]
 

Definition at line 34 of file lines_meet_algorithm.hpp.

Referenced by calculate(), lines_meet_algorithm(), and ~lines_meet_algorithm().


The documentation for this class was generated from the following files:
Generated on Fri May 19 19:30:29 2006 for geometria by  doxygen 1.4.6-NO