Getting distance between two vertices

Discussion in 'AutoCAD' started by ajtruckle, Mar 3, 2005.

  1. ajtruckle

    ajtruckle Guest

    Hello

    I have two variants holding the 3d coordinates of two points. I want to know the planimetric distance between the two points (x/y) only. How do I do that?

    These points are in world coordinate system..

    Thanks.

    Andrew
     
    ajtruckle, Mar 3, 2005
    #1
  2. ajtruckle

    ajtruckle Guest

    Done:

    Public Function Get2DLength(aryPoint1 As Variant, _
    aryPoint2 As Variant) As Double

    Dim dDeltaX As Double
    Dim dDeltaY As Double

    dDeltaX = aryPoint2(0) - aryPoint1(0)
    dDeltaY = aryPoint2(1) - aryPoint1(1)

    Get2DLength = Sqr((dDeltaX * dDeltaX) + (dDeltaY * dDeltaY))

    End Function
     
    ajtruckle, Mar 3, 2005
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.