# Calculate what points are on the right side of a line and on the left side of the same line

Dears,

I’m trying to identify the points are in the left and right side of a line.

You could watch what I’m trying to do in that instance.

What I’m thinking consist of getting a normal vector from the line to all points. Vectors are positive, points are on the right side, vectors are negative, points are on the left side.

With de negative or positive vector to each point it could be easy to filter the points.

But, how could I calculate a normal vector between the line and points, and identify which one is negative or positive.

Regards,

1. Geometry.ClosestPointTo node to find the point on the curve which is closest to each point.
2. Vector.ByTwoPoint to build a vector from the point on the line to the associated point in space.
3. Curve.ParameterAtPoint to find the parameter of the curve where the points on the line (step 1) are located.
4. Curve.Tangent at Parameter and Curve.Normal at parameter to find the direction the curve is moving at that point and the normal of the curve at that point.
5. Vector.AngleAboutAxis using the tangent as the first vector, the vector by points as the second, and the normal as the axis.
6. If angle < 180, “Right Side”, otherwise “Left Side”.

Note that this does not account for the edge case where the point is on the curve or in line with the extended tangent (the 0 or 180 degree angles, or null values when trying to draw the vector by two points)

Jacob,