Git Product home page Git Product logo

Comments (5)

alexbol99 avatar alexbol99 commented on July 30, 2024

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

from flatten-js.

redexp avatar redexp commented on July 30, 2024

@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?

from flatten-js.

redexp avatar redexp commented on July 30, 2024

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?

from flatten-js.

alexbol99 avatar alexbol99 commented on July 30, 2024

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))

from flatten-js.

redexp avatar redexp commented on July 30, 2024

Thank you for explanation

from flatten-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.