VisiLibity v1 Source Code 1.0
Public Member Functions | Protected Attributes | List of all members
VisiLibity::Polar_Point Class Reference

Point in the plane packaged together with polar coordinates w.r.t. specified origin. More...

#include <visilibity.hpp>

Inheritance diagram for VisiLibity::Polar_Point:
VisiLibity::Point VisiLibity::Visibility_Polygon::Polar_Point_With_Edge_Info

Public Member Functions

 Polar_Point ()
 default More...
 
 Polar_Point (const Point &polar_origin_temp, const Point &point_temp, double epsilon=0.0)
 construct from (Cartesian) Points More...
 
Point polar_origin () const
 origin of the polar coordinate system in which the point is represented
 
double range () const
 
Angle bearing () const
 bearing from polar origin w.r.t. direction parallel to x-axis
 
void set_polar_origin (const Point &polar_origin_temp)
 set the origin of the polar coordinate system More...
 
void set_x (double x_temp)
 set x More...
 
void set_y (double y_temp)
 set y More...
 
void set_range (double range_temp)
 set range More...
 
void set_bearing (const Angle &bearing_temp)
 set bearing More...
 
void set_bearing_to_2pi ()
 set bearing Angle data to 2*M_PI More...
 
- Public Member Functions inherited from VisiLibity::Point
 Point ()
 default More...
 
 Point (double x_temp, double y_temp)
 costruct from raw coordinates
 
double x () const
 get x coordinate
 
double y () const
 get y coordinate
 
Point projection_onto (const Line_Segment &line_segment_temp) const
 closest Point on line_segment_temp More...
 
Point projection_onto (const Ray &ray_temp) const
 closest Point on ray_temp More...
 
Point projection_onto (const Polyline &polyline_temp) const
 closest Point on polyline_temp More...
 
Point projection_onto_vertices_of (const Polygon &polygon_temp) const
 closest vertex of polygon_temp More...
 
Point projection_onto_vertices_of (const Environment &enviroment_temp) const
 closest vertex of environment_temp More...
 
Point projection_onto_boundary_of (const Polygon &polygon_temp) const
 closest Point on boundary of polygon_temp More...
 
Point projection_onto_boundary_of (const Environment &enviroment_temp) const
 closest Point on boundary of environment_temp More...
 
bool on_boundary_of (const Polygon &polygon_temp, double epsilon=0.0) const
 true iff w/in epsilon of boundary of polygon_temp More...
 
bool on_boundary_of (const Environment &environment_temp, double epsilon=0.0) const
 true iff w/in epsilon of boundary of environment_temp More...
 
bool in (const Line_Segment &line_segment_temp, double epsilon=0.0) const
 true iff w/in epsilon of line_segment_temp More...
 
bool in_relative_interior_of (const Line_Segment &line_segment_temp, double epsilon=0.0) const
 true iff w/in epsilon of interior but greater than espilon away from endpoints of line_segment_temp More...
 
bool in (const Polygon &polygon_temp, double epsilon=0.0) const
 true iff w/in epsilon of polygon_temp More...
 
bool in (const Environment &environment_temp, double epsilon=0.0) const
 true iff w/in epsilon of environment_temp More...
 
bool is_endpoint_of (const Line_Segment &line_segment_temp, double epsilon=0.0) const
 true iff w/in epsilon of some endpoint of line_segment_temp More...
 
void set_x (double x_temp)
 change x coordinate
 
void set_y (double y_temp)
 change y coordinate
 
void snap_to_vertices_of (const Polygon &polygon_temp, double epsilon=0.0)
 relocate to closest vertex if w/in epsilon of some vertex (of polygon_temp) More...
 
void snap_to_vertices_of (const Environment &environment_temp, double epsilon=0.0)
 relocate to closest vertex if w/in epsilon of some vertex (of environment_temp) More...
 
void snap_to_boundary_of (const Polygon &polygon_temp, double epsilon=0.0)
 relocate to closest Point on boundary if w/in epsilon of the boundary (of polygon_temp) More...
 
void snap_to_boundary_of (const Environment &environment_temp, double epsilon=0.0)
 relocate to closest Point on boundary if w/in epsilon of the boundary (of environment_temp) More...
 

Protected Attributes

Point polar_origin_
 
double range_
 
Angle bearing_
 
- Protected Attributes inherited from VisiLibity::Point
double x_
 
double y_
 

Detailed Description

Point in the plane packaged together with polar coordinates w.r.t. specified origin.

The origin of the polar coordinate system is stored with the Polar_Point (in polar_origin_) and bearing is measured ccw from the positive x-axis.

Remarks
used, e.g., for radial line sweeps

Constructor & Destructor Documentation

◆ Polar_Point() [1/2]

VisiLibity::Polar_Point::Polar_Point ( )
inline

default

Remarks
Data defaults to NAN so that checking whether the data are numbers can be used as a precondition in functions.

◆ Polar_Point() [2/2]

VisiLibity::Polar_Point::Polar_Point ( const Point polar_origin_temp,
const Point point_temp,
double  epsilon = 0.0 
)

construct from (Cartesian) Points

Precondition
member data of polar_origin_temp and point_temp have been assigned (numbers)
Parameters
polar_origin_tempthe origin of the polar coordinate system
point_tempthe point to be represented
Remarks
if polar_origin_temp == point_temp, the default bearing is Angle(0.0)

Member Function Documentation

◆ range()

double VisiLibity::Polar_Point::range ( ) const
inline

Euclidean distance from the point represented to the origin of the polar coordinate system

◆ set_bearing()

void VisiLibity::Polar_Point::set_bearing ( const Angle bearing_temp)

set bearing

Remarks
polar_origin and range held constant, x and y modified accordingly

◆ set_bearing_to_2pi()

void VisiLibity::Polar_Point::set_bearing_to_2pi ( )
inline

set bearing Angle data to 2*M_PI

Remarks
Special function for use in computations involving a radial line sweep; sometimes it is necessary to set the angle value to 2*PI instead of 0, so that the lex. inequalities behave appropriately

◆ set_polar_origin()

void VisiLibity::Polar_Point::set_polar_origin ( const Point polar_origin_temp)

set the origin of the polar coordinate system

Remarks
x and y held constant, bearing and range modified accordingly

◆ set_range()

void VisiLibity::Polar_Point::set_range ( double  range_temp)

set range

Remarks
polar_origin held constant, x and y modified accordingly

◆ set_x()

void VisiLibity::Polar_Point::set_x ( double  x_temp)

set x

Remarks
polar_origin held constant, bearing and range modified accordingly

◆ set_y()

void VisiLibity::Polar_Point::set_y ( double  y_temp)

set y

Remarks
polar_origin held constant, bearing and range modified accordingly

The documentation for this class was generated from the following files: