GFMathsmod/Testfrm.frm
VERSION 5.00
Begin VB.Form Testfrm
Caption = "GFMathsmod test form"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4650
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4650
StartUpPosition = 3 'Windows‑Standard
End
Attribute VB_Name = "Testfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'(c)2001, 2004 by Louis.
'
'Downloaded from www.louis‑coder.com.
'Some usable geometry functions:
'‑GetPointPointDistLong2D(): calculates the distance between the two passed points
' (output unit is the unit of the passed points)
'‑GetPointLineDistLong3D(): calculates the (shortest) distance between a point and a
' line in 3D space
'‑GetPointPointDistSingle3D(): same as before, but with Single‑variables
' (more precision, but slower).
'‑GetLinePlaneIntersectionPoint(): determines the intersection point between a line
' and a plane
'Please note that the used algorithms are rather simple (not optimized for speed),
'here taught in the 12th and 13th school grade.
Private Sub Form_Load()
'on error resume next
'
Debug.Print GetPointLineDistLong3D(2, 43, 4, 2, 1, 3, 23, 1, 5)
'
Dim Plane As PlaneSingle3D
Dim Line As LineSingle3D
'
Plane.a1 = 1
Plane.a2 = 1
Plane.a3 = 4
Plane.a4 = 6
'
Line.X1 = 0
Line.Y1 = 0
Line.Z1 = 1
Line.X2 = 0
Line.Y2 = 0
Line.Z2 = ‑1
'
Dim p As PointSingle3D
'
Debug.Print GetLinePlaneIntersectionPoint(Line, Plane, p)
Debug.Print p.X
Debug.Print p.Y
Debug.Print p.Z
'
End Sub
[END OF FILE]