OpendTect  7.0
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 (const Coord &, const Coord &)
 
 Line2 (const Coord &, double slope)
 
 Line2 (double slope=0, double intcpt=0)
 
Coord closestPoint (const Coord &point) const
 
Coord direction () const
 
double distanceTo (const Line2 &) const
 
bool getParallelLine (Line2 &line, double dist) const
 
bool getPerpendicularLine (Line2 &line, const Coord &pt) const
 
Coord intersection (const Line2 &, bool checkinlimit=true) const
 
bool isOnLine (const Coord &pt) const
 
bool operator== (const Line2 &) const
 

Public Attributes

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

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() [1/3]

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

◆ Line2() [2/3]

Line2::Line2 ( const Coord ,
double  slope 
)

◆ Line2() [3/3]

Line2::Line2 ( const Coord ,
const Coord  
)

Member Function Documentation

◆ closestPoint()

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

◆ direction()

Coord Line2::direction ( ) const

Normalized

◆ distanceTo()

double Line2::distanceTo ( const Line2 ) const

Gives distance to another parallel line

◆ getParallelLine()

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

Gives a parallel line at a distance dist

◆ getPerpendicularLine()

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

Gives a perpendicular line through point pt

◆ intersection()

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

◆ isOnLine()

bool Line2::isOnLine ( const Coord pt) const

◆ operator==()

bool Line2::operator== ( const Line2 ) const

Member Data Documentation

◆ isvertical_

bool Line2::isvertical_

Parallel to y-axis

◆ slope_

double Line2::slope_

◆ start_

Coord Line2::start_

For line-segments only

◆ stop_

Coord Line2::stop_

For line-segments only

◆ xintcpt_

double Line2::xintcpt_

only if isvertical_ true

◆ yintcpt_

double Line2::yintcpt_

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