OpendTect-6_4  6.4
Public Member Functions | Public Attributes | List of all members
Line2 Class Reference

A Line2 is a line on XY-plane, and it is defined in slope-intercept form y = slope*x + y-intercept; for making operations easier. More...

Public Member Functions

 Line2 (double slope=0, double intcpt=0)
 
 Line2 (const Coord &, double slope)
 
 Line2 (const Coord &, const Coord &)
 
bool operator== (const Line2 &) const
 
Coord direction () const
 
Coord closestPoint (const Coord &point) const
 
Coord intersection (const Line2 &, bool checkinlimit=true) const
 
double distanceTo (const Line2 &) const
 
bool getParallelLine (Line2 &line, double dist) const
 
bool getPerpendicularLine (Line2 &line, const Coord &pt) const
 
bool isOnLine (const Coord &pt) const
 

Public Attributes

double slope_
 
double yintcpt_
 
bool isvertical_
 
double xintcpt_
 
Coord start_
 
Coord stop_
 

Detailed Description

A Line2 is a line on XY-plane, and it is defined in slope-intercept form y = slope*x + y-intercept; for making operations easier.

Constructor & Destructor Documentation

Line2::Line2 ( double  slope = 0,
double  intcpt = 0 
)
Line2::Line2 ( const Coord ,
double  slope 
)
Line2::Line2 ( const Coord ,
const Coord  
)

Member Function Documentation

Coord Line2::closestPoint ( const Coord point) const
Returns
the point on the line that is closest to the given point
Coord Line2::direction ( ) const

Normalized

double Line2::distanceTo ( const Line2 ) const

Gives distance to another parallel line

bool Line2::getParallelLine ( Line2 line,
double  dist 
) const

Gives a parallel line at a distance dist

bool Line2::getPerpendicularLine ( Line2 line,
const Coord pt 
) const

Gives a perpendicular line through point pt

Coord Line2::intersection ( const Line2 ,
bool  checkinlimit = true 
) const
bool Line2::isOnLine ( const Coord pt) const
bool Line2::operator== ( const Line2 ) const

Member Data Documentation

bool Line2::isvertical_

Parallel to y-axis

double Line2::slope_
Coord Line2::start_

For line-segments only

Coord Line2::stop_

For line-segments only

double Line2::xintcpt_

only if isvertical_ true

double Line2::yintcpt_

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019