Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
flightzone.c File Reference

Check whether a point is inside the polygon limiting the competition area. More...

#include "flightzone.h"
+ Include dependency graph for flightzone.c:

Go to the source code of this file.

Data Structures

struct  POINT
 

Functions

void vInitIsInsideBoundaries (void)
 
int iIsInsideBoundaries (COORD_TYPE x, COORD_TYPE y)
 

Variables

POINT Corner []
 
POINT Orthogonal [20]
 
unsigned char bNumberOfCorners = 0
 

Detailed Description

Check whether a point is inside the polygon limiting the competition area.

todo: - support concave/convex polygons

  • sort points automatically
  • minimize size of Orthogonal[]

limitations: - boundary polygon has to be convex

  • points have to be ordered clockwise

author: Arnold Schroeter history: 2.9.07 initial version

author: Arnold Schroeter history: 2.9.07 initial version

Definition in file flightzone.c.

Function Documentation

int iIsInsideBoundaries ( COORD_TYPE  x,
COORD_TYPE  y 
)

Definition at line 95 of file flightzone.c.

References bNumberOfCorners.

void vInitIsInsideBoundaries ( void  )

Definition at line 64 of file flightzone.c.

References bNumberOfCorners, Corner, POINT::x, and POINT::y.

Variable Documentation

unsigned char bNumberOfCorners = 0

Definition at line 58 of file flightzone.c.

Referenced by iIsInsideBoundaries(), and vInitIsInsideBoundaries().

POINT Corner[]
Initial value:
= {
12, 18,
12, 25,
15, 29,
18, 25,
18, 18,
13.5, 16,
0 , 0}

Definition at line 47 of file flightzone.c.

Referenced by vInitIsInsideBoundaries().

POINT Orthogonal[20]

Definition at line 56 of file flightzone.c.