Author Topic: Point3d coordinates...what type are the x and y coordinates?  (Read 1857 times)

0 Members and 1 Guest are viewing this topic.

Proctor

  • Guest
Point3d coordinates...what type are the x and y coordinates?
« on: November 10, 2011, 01:47:43 PM »
Hello: In my application, I'm looping through a polyline the user selects and getting a point at a distance (as a point3d). There's a lot that happens after that...but to make a long story short, the x and y coordinates get converted to singles and stored into a collection as nodes. Later in my app, I need to see if the point is on the polyline; however, because I converted them to singles, it doesn't find the point on the poly...and so my first question I'm curious about is when I create a point as point3d, what type of number are the x and y coordinates?

I'm also wondering if there is anyway to convert the coordinates back so that they match what ever type they were originally so that i can detect if the point is on the poly?

Hope this makes sense...let me know if not.

Thanks,
Proctor

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Point3d coordinates...what type are the x and y coordinates?
« Reply #1 on: November 10, 2011, 02:03:35 PM »
X and Y are doubles.

You can also save the points as point3d in a point3dcollection.

Further you can keep the polyline in a polyline object so you can refer to that all the time, instead of single points.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Proctor

  • Guest
Re: Point3d coordinates...what type are the x and y coordinates?
« Reply #2 on: November 10, 2011, 02:21:18 PM »
huiz
 Thanks so much for your reply...it's good to know that those coordinates are doubles.
There's lots of calculations that are taking place in my application and so I need to have the values as singles. Although I do store these origional points into a collection,
only some of them are converted into nodes (which are essentially points as singles) and then edges are created with these.
do you know if there's anyway to reverse a single to a double? that would be the easiest solution if it's possible.

thanks again,
Proctor

RMS

  • Guest
Re: Point3d coordinates...what type are the x and y coordinates?
« Reply #3 on: November 10, 2011, 07:05:10 PM »
Try this out:

Code: [Select]
    <CommandMethod("mtest")> _
    Public Sub ListEntities()

        Dim s As Single = 22.5
        Dim d As Double = 0.0

        d = CType(s, Single)

        MsgBox(d.ToString)


    End Sub

MCOONROD

  • Guest
Re: Point3d coordinates...what type are the x and y coordinates?
« Reply #4 on: November 10, 2011, 07:59:10 PM »
You are probably aware of this but I have to throw it out there. There is a lot of accuracy loss in a double to single and back conversion.

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Point3d coordinates...what type are the x and y coordinates?
« Reply #5 on: November 11, 2011, 01:45:00 PM »
There also might not be a reason to convert all the time, you can refer to X and Y of a point with Point3D.X and Point3D.Y too.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.