proj home

Files   Classes   Functions   Hierarchy  

d2linesegment Class Reference

Line segment and with line segement intersection test. More...

#include <d2linesegment.h>

Collaboration diagram for d2linesegment:

List of all members.

Public Member Functions

bool const intersects (d2linesegment const &s2) const
 Do the two line segments intersect?
void rotate (double const theta)
 Anticlockwise rotation of the simplex about its center.
void translate (pt2c &x)
 Shift the simplex.

Public Attributes

point2< double > v [2]
 Points defining the line segment.


Detailed Description

Line segment and with line segement intersection test.

Definition at line 7 of file d2linesegment.h.


Member Function Documentation

bool const d2linesegment::intersects ( d2linesegment const &  s2  )  const

Do the two line segments intersect?

Definition at line 19 of file d2linesegment.cpp.

References lineSegmentIntersection(), and v.

00020 {
00021   return lineSegmentIntersection(v[0],v[1],s2.v[0],v2.v[1],1E-5);
00022 }

void d2linesegment::rotate ( double const   theta  ) 

Anticlockwise rotation of the simplex about its center.

Definition at line 11 of file d2linesegment.cpp.

References v.

00012 {
00013   R.setRotateAboutPoint(theta,v[0]);
00014 
00015   for (uint i=0; i<2; ++i)
00016     R.matrixMultiply(v[i]);
00017 }

void d2linesegment::translate ( pt2c x  ) 

Shift the simplex.

Definition at line 5 of file d2linesegment.cpp.

References v.

00006 {
00007   for (uint i=0; i<2; ++i)
00008     v[i] += x; 
00009 }


Member Data Documentation

Points defining the line segment.

Definition at line 12 of file d2linesegment.h.

Referenced by intersects(), rotate(), and translate().


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

Generated on Fri Mar 4 00:49:52 2011 for Chelton Evans Source by  doxygen 1.5.8