VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "QuadraticCurve" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Implements Curve Public a As Double Public b As Double Public c As Double Public Function getYIntercept() As Double getYIntercept = c End Function Public Function getEquation() As String Dim str As String str = "y = " If a = -1 Then str = str & "-" ElseIf a <> 1 Then str = str & a End If str = str & "x^2" If b = -1 Then str = str & " -x" ElseIf b > 0 Then str = str & " + " & b & "x" ElseIf b < 0 Then str = str & " - " & -b & "x" End If If c > 0 Then str = str & " + " & c ElseIf c < 0 Then str = str & " - " & -c End If getEquation = str End Function Public Function getExtremePoint() As Point Dim aPoint As Point aPoint.x = -b / 2 / a aPoint.y = a * (aPoint.x) ^ 2 + b * (aPoint.x) + c getExtremePoint = aPoint End Function Public Sub initialize(aA As Double, aB As Double, aC As Double) a = aA b = aB c = aC End Sub Private Function Curve_getEquation() As String Curve_getEquation = getEquation End Function Private Function Curve_getYIntercept() As Double Curve_getYIntercept = getYIntercept End Function