libgeda
|
Low-level mathmatical functions for lines. More...
#include <config.h>
#include <math.h>
#include <stdio.h>
#include "libgeda_priv.h"
Go to the source code of this file.
Functions | |
double | m_line_shortest_distance (LINE *line, int x, int y) |
Calculates the distance between the given point and the closest point on the given line segment. |
Definition in file m_line.c.
double m_line_shortest_distance | ( | LINE * | line, |
int | x, | ||
int | y | ||
) |
If the closest point on the line resides beyond the line segment's end point, this function returns the distance from the given point to the closest end point.
If the line represents a single point (the endpoints are the same), this function calcualtes the distance to that point.
[in] | line | The LINE object. |
[in] | x | The x coordinate of the given point. |
[in] | y | The y coordinate of the given point. |