libgeda

m_line.c File Reference

Low-level mathmatical functions for lines. More...

#include <config.h>
#include <math.h>
#include <stdio.h>
#include "libgeda_priv.h"
Include dependency graph for m_line.c:

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.

Detailed Description

Definition in file m_line.c.


Function Documentation

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.

Parameters:
[in]lineThe LINE object.
[in]xThe x coordinate of the given point.
[in]yThe y coordinate of the given point.
Returns:
The shortest distance from the object to the point. With an invalid parameter, this function returns G_MAXDOUBLE.

Definition at line 53 of file m_line.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines