The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



How to Use SLine


The class TSLine implements a class which allows to calculate with and around straight lines in two-dimensional space. The mathematical equation used in this class is

Ax + By + C = 0

You may set up a particular line by either specifiying the parameters A, B, and C (properties ParA, ParB, and ParC), or by using one of the following methods:

  • LineFrom2Points calculates the line parameters from two 2D-points
  • LineFromSlopeIcpt determines the line parameters from the slope and the intercept of the line
  • LineThroughPoint specifies the line parameters by a single 2D-point and the angle beween the line and the x-axis.
Further, there are several properties and methods to get more information about the particular line, or two lines, or a line and a point:
  • Direction calculates the direction of the line
  • Intercept returns the intercept at the y-axis
  • Slope returns the slope of the line
  • AngleBetweenLines calculates the angle between two lines
  • Intersection calculates the intersection point
  • Distance returns the (normal) distance between a point and the line
  • CalcY calculates the y-value for a given x
  • CalcX calculates the x-value for a given y
The following two methods allow to create perpendicular and parallel lines:


Last Update: 2013-May-14