mathnet / mathnet-spatial

Math.NET Spatial
http://spatial.mathdotnet.com
MIT License
376 stars 132 forks source link

Get X and Y values for Point2D? #240

Closed minystreem56 closed 1 month ago

minystreem56 commented 2 months ago

I can't figure out how to get the x and y cordnets of a point2d, I have tried point.getX(), point.getx(), point.x, point.X, getX(point), getx(point), but none of them work, any ideas?

jkalias commented 2 months ago

point.X

minystreem56 commented 2 months ago

I tried that, but it did not work

jkalias commented 2 months ago

image I can't really believe that

minystreem56 commented 2 months ago

Thats really werid. I can try it, but I swear it didn't work. Thanks!

jkalias commented 2 months ago

No worries. I would also close the issue once you figure this out, perhaps writing a comment for future reference

minystreem56 commented 2 months ago

Werid, I just tried that and I got this error: error CS1061: 'Point2D?' does not contain a definition for 'X' and no accessible extension method 'X' accepting a first argument of type 'Point2D?' could be found (are you missing a using directive or an assembly reference?)

minystreem56 commented 2 months ago

Ok so it works, but I am using the IntersectWith function which returns a nullable point2d, so the problem may lie with the fact that it is nullable?

jkalias commented 2 months ago

That's what got me worried in your previous reply, that the Point2D was nullable. No, the IntersectWith should indeed return nullable, since there is also the possibility, that no intersection occurs.

I am guessing you are using Line2D.IntersectWith, so when the lines are parallel there is no intersection.

jkalias commented 1 month ago

@minystreem56 Would you mind if I close this issue now?

minystreem56 commented 1 month ago

No, I do not mind

On Fri, Jul 5, 2024, 6:08 AM jkalias @.***> wrote:

@minystreem56 https://github.com/minystreem56 Would you mind if I close this issue now?

— Reply to this email directly, view it on GitHub https://github.com/mathnet/mathnet-spatial/issues/240#issuecomment-2210681364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV5367UPPKWYV63V6E3TUIDZKZ5EBAVCNFSM6AAAAABI4Z77IKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGY4DCMZWGQ . You are receiving this because you were mentioned.Message ID: @.***>