libgeda

m_box.c File Reference

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

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

Go to the source code of this file.

Functions

double m_box_shortest_distance (BOX *box, int x, int y, int solid)
 Calculates the distance between the given point and the closest point on the perimeter or interior of the box.

Detailed Description

Definition in file m_box.c.


Function Documentation

double m_box_shortest_distance ( BOX box,
int  x,
int  y,
int  solid 
)
Parameters:
[in]boxThe box.
[in]xThe x coordinate of the given point.
[in]yThe y coordinate of the given point.
[in]solidTRUE if the box should be treated as solid, FALSE if the box should be treated as hollow.
Returns:
The shortest distance from the box 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_box.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines