Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get X and Y values for Point2D? #240

Closed
minystreem56 opened this issue Jun 6, 2024 · 10 comments
Closed

Get X and Y values for Point2D? #240

minystreem56 opened this issue Jun 6, 2024 · 10 comments

Comments

@minystreem56
Copy link

minystreem56 commented Jun 6, 2024

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
Copy link
Member

jkalias commented Jun 6, 2024

point.X

@minystreem56
Copy link
Author

I tried that, but it did not work

@jkalias
Copy link
Member

jkalias commented Jun 8, 2024

image
I can't really believe that

@minystreem56
Copy link
Author

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

@jkalias
Copy link
Member

jkalias commented Jun 8, 2024

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

@minystreem56
Copy link
Author

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
Copy link
Author

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
Copy link
Member

jkalias commented Jun 10, 2024

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
Copy link
Member

jkalias commented Jul 5, 2024

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

@minystreem56
Copy link
Author

minystreem56 commented Jul 5, 2024 via email

@jkalias jkalias closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants