If we define dx = x2 - x1
and dy = y2 - y1
, then the normals are (-dy, dx)
and (dy, -dx)
.
Note that no division is required, and so you’re not risking dividing by zero.
More Related Contents:
- Using atan2 to find angle between two vectors
- Signed angle between two 3D vectors with same origin within the same plane
- Calculate distance between 2 GPS coordinates
- Generate a random point within a circle (uniformly)
- How to determine if a list of polygon points are in clockwise order?
- A simple algorithm for polygon intersection
- Turning a cylinder into a sphere without pinching at the poles
- Finding quaternion representing the rotation from one vector to another
- How to calculate the volume of a 3D mesh object the surface of which is made up triangles
- Cone to box collision
- Calculating area enclosed by arbitrary polygon on Earth’s surface
- How do I combine complex polygons?
- correcting fisheye distortion programmatically
- Implementing Ray Picking
- Rotating a Vector in 3D Space
- How do I detect intersections between a circle and any other circle in the same plane?
- Projecting 3D points to 2D plane [closed]
- How to distribute points evenly on the surface of hyperspheres in higher dimensions?
- Perpendicular on a line from a given point
- Finding the coordinates of points from distance matrix
- how map 2d grid points (x,y) onto sphere as 3d points (x,y,z)
- 3D coordinates on a sphere to Latitude and Longitude
- Calculate rotated rectangle size from known bounding box coordinates
- How to best approximate a geometrical arc with a Bezier curve?
- Get bounds of rotated rectangle
- Sort points in clockwise order?
- How do you calculate the average of a set of circular data? [closed]
- Draw a quadratic Bézier curve through three given points
- Designing function f(f(n)) == -n
- Get direction (compass) with two longitude/latitude points