libgeda

m_circle.c File Reference

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

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

Go to the source code of this file.

Functions

double m_circle_shortest_distance (CIRCLE *circle, int x, int y, int solid)
 Calculates the distance between the given point and the closest point on the perimeter or interior of the circle.

Detailed Description

Definition in file m_circle.c.


Function Documentation

double m_circle_shortest_distance ( CIRCLE circle,
int  x,
int  y,
int  solid 
)
Parameters:
[in]circleThe circle.
[in]xThe x coordinate of the given point.
[in]yThe y coordinate of the given point.
[in]solidTRUE if the circle should be treated as solid, FALSE if the circle should be treated as hollow.
Returns:
The shortest distance from the circle to the point. With a solid shape, this function returns a distance of zero for interior points. With an invalid parameter, this function returns G_MAXDOUBLE.

Definition at line 49 of file m_circle.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines