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

Can you please explain why norm of Line is 90 CCW from it vector? #40

Closed
redexp opened this issue Mar 15, 2020 · 5 comments
Closed

Can you please explain why norm of Line is 90 CCW from it vector? #40

redexp opened this issue Mar 15, 2020 · 5 comments
Labels

Comments

@redexp
Copy link
Contributor

redexp commented Mar 15, 2020

Hello, I'm trying to figure out why Flatten.Line has norm vector which is 90 CCW from original vector? It was surprise for me that to build vertical line code should be NOT

new Line(new Point(10, 10), new Vector(0, 1))

it should be

new Line(new Point(10, 10), new Vector(-1, 0))

instead. In docs it says just norm - normal vector to a line, nothing about 90 CCW.

Thanks great lib.

@alexbol99
Copy link
Owner

Hello, @redexp Sergii

I don't understand what do you mean by "original vector", but both options are valid.
Both options give same vertical line that passes through the point (10,10)
What kind of problem you have with this definition?

Best regards,
Alex

@redexp
Copy link
Contributor Author

redexp commented Mar 15, 2020

@alexbol99 as for me, first one should be vertical line, but it is horizontal line. To build vertical line I need to pass horizontal vector, why?

@redexp
Copy link
Contributor Author

redexp commented Mar 15, 2020

This is vertical vector new Vector(0, 1) right? and with it we should build vertical line like this new Line(new Point(10, 10), new Vector(0, 1)), right?

@alexbol99
Copy link
Owner

My answer was quick and incomplete.
Constructing of the line with normal vector (n) and point (pt0) means definition of the line equation in vector form :

 n * p = 0

where
norm - normal (ortogonal) vector to a line
p = pt - pt0 - vector from a point p0 that line passes through to an arbitrary point on a line
and '*'' is a scalar product

So, in order to construct vertical line you need to create horizontal vector, and both

new Line(new Point(10, 10), new Vector(-1, 0))

and

new Line(new Point(10, 10), new Vector(1, 0))

are constructors for same vertical line.

You also have an option to construct line that pass through two points, like this:

new Line(new Point(10, 10), new Point(10,20))

@redexp
Copy link
Contributor Author

redexp commented Mar 16, 2020

Thank you for explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants