VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "Line" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Implements Curve Private mRefPoint As Point Public slope As Double Public Property Let refPoint(aPoint As Point) mRefPoint = aPoint End Property Public Property Get refPoint() As Point refPoint = mRefPoint End Property Public Function getYIntercept() As Double getYIntercept = mRefPoint.Y - slope * mRefPoint.X End Function Public Function getEquation() As String Dim str As String Dim yInt As Double yInt = getYIntercept 'construct the equation string str = "y = " If slope = 0 Then str = str & yInt Else If slope = -1 Then str = str & "-" ElseIf slope <> 1 Then str = str & slope End If str = str & "x" If yInt > 0 Then str = str & " + " & yInt ElseIf yInt < 0 Then str = str & " - " & -yInt End If End If 'return the string getEquation = str End Function Public Sub initialize(aPoint As Point, aSlope As Double) refPoint = aPoint slope = aSlope End Sub Private Function Curve_getEquation() As String Curve_getEquation = getEquation End Function Private Function Curve_getYIntercept() As Double Curve_getYIntercept = getYIntercept End Function