Functions
Returns the center point of the circle.
Parameters:
Name Type Description c Circle
The circle to get the center point
Return Type: Point 2d
Signatures:
point_2d center_point ( const circle & c )
public static Point2D Geometry . CenterPoint (Circle c);
public static Point2D SplashKit . CenterPoint (Circle c);
function CenterPoint ( const c: Circle): Point2D
Returns a circle at the indicated point and radius.
Parameters:
Name Type Description pt Point 2d
The location of the center of the circle radius Double
The radius of the circle
Return Type: Circle
Signatures:
circle circle_at ( const point_2d & pt , double radius )
public static Circle Geometry . CircleAt (Point2D pt, double radius);
public static Circle SplashKit . CircleAt (Point2D pt, double radius);
def circle_at ( pt , radius ) :
function CircleAt ( const pt: Point2D; radius: Double ): Circle
Returns a circle at the indicated point and radius.
Parameters:
Name Type Description x Double
The x location of the circle y Double
The y location of the circle radius Double
The radius of the circle
Return Type: Circle
Signatures:
circle circle_at ( double x , double y , double radius )
public static Circle Geometry . CircleAt ( double x, double y, double radius);
public static Circle SplashKit . CircleAt ( double x, double y, double radius);
def circle_at_from_points ( x , y , radius ) :
function CircleAt (x: Double ; y: Double ; radius: Double ): Circle
Returns the circle radius.
Parameters:
Name Type Description c Circle
The circle
Return Type: Float
Signatures:
float circle_radius ( const circle c )
public static float Geometry . CircleRadius (Circle c);
public static float SplashKit . CircleRadius (Circle c);
function CircleRadius (c: Circle): Single
Returns the circle x value.
Parameters:
Name Type Description c Circle
The circle
Return Type: Float
Signatures:
float circle_x ( const circle & c )
public static float Geometry . CircleX (Circle c);
public static float SplashKit . CircleX (Circle c);
function CircleX ( const c: Circle): Single
Returns the circle y value.
Parameters:
Name Type Description c Circle
The circle
Return Type: Float
Signatures:
float circle_y ( const circle & c )
public static float Geometry . CircleY (Circle c);
public static float SplashKit . CircleY (Circle c);
function CircleY ( const c: Circle): Single
Detects if two circles intersect. This can be used to detect collisions between bounding circles.
Parameters:
Name Type Description c1 Circle
The circle to test if intersects with c2 c2 Circle
The circle to test if intersects with c1
Return Type: Boolean
Signatures:
bool circles_intersect (circle c1 , circle c2 )
public static bool Geometry . CirclesIntersect (Circle c1, Circle c2);
public static bool SplashKit . CirclesIntersect (Circle c1, Circle c2);
def circles_intersect ( c1 , c2 ) :
function CirclesIntersect (c1: Circle; c2: Circle): Boolean
Detects if two circles intersect. This can be used to detect collisions between bounding circles. The circle data is passed in as individual values.
Parameters:
Name Type Description c1_x Double
the x location of the first circle c1_y Double
the y location of the first circle c1_radius Double
the radius of the first circle c2_x Double
the x location of the second circle c2_y Double
the y location of the second circle c2_radius Double
the radius of the second circle
Return Type: Boolean
Signatures:
bool circles_intersect ( double c1_x , double c1_y , double c1_radius , double c2_x , double c2_y , double c2_radius )
public static bool Geometry . CirclesIntersect ( double c1X, double c1Y, double c1Radius, double c2X, double c2Y, double c2Radius);
public static bool SplashKit . CirclesIntersect ( double c1X, double c1Y, double c1Radius, double c2X, double c2Y, double c2Radius);
def circles_intersect_using_values ( c1_x , c1_y , c1_radius , c2_x , c2_y , c2_radius ) :
function CirclesIntersect (c1X: Double ; c1Y: Double ; c1Radius: Double ; c2X: Double ; c2Y: Double ; c2Radius: Double ): Boolean
The closest point on the circle to the given point.
Parameters:
Name Type Description from_pt Point 2d
The point to test from c Circle
The circle you want to get a point on its circumference
Return Type: Point 2d
Signatures:
point_2d closest_point_on_circle ( const point_2d & from_pt , const circle & c )
public static Point2D Geometry . ClosestPointOnCircle (Point2D fromPt, Circle c);
public static Point2D SplashKit . ClosestPointOnCircle (Point2D fromPt, Circle c);
def closest_point_on_circle ( from_pt , c ) :
function ClosestPointOnCircle ( const fromPt: Point2D; const c: Circle): Point2D
Returns the closest point on a line to a circle.
Parameters:
Return Type: Point 2d
Signatures:
point_2d closest_point_on_line_from_circle ( const circle & c , const line & l )
public static Point2D Geometry . ClosestPointOnLineFromCircle (Circle c, Line l);
public static Point2D SplashKit . ClosestPointOnLineFromCircle (Circle c, Line l);
def closest_point_on_line_from_circle ( c , l ) :
function ClosestPointOnLineFromCircle ( const c: Circle; const l: Line): Point2D
Returns the closest point on a rectangle to a circle.
Parameters:
Return Type: Point 2d
Signatures:
point_2d closest_point_on_rect_from_circle ( const circle & c , const rectangle & rect )
public static Point2D Geometry . ClosestPointOnRectFromCircle (Circle c, Rectangle rect);
public static Point2D SplashKit . ClosestPointOnRectFromCircle (Circle c, Rectangle rect);
def closest_point_on_rect_from_circle ( c , rect ) :
function ClosestPointOnRectFromCircle ( const c: Circle; const rect: Rectangle): Point2D
The furthest point on the circle to the given point.
Parameters:
Name Type Description pt Point 2d
The point to test from c Circle
The circle you want to get a point on its circumference
Return Type: Point 2d
Signatures:
point_2d distant_point_on_circle ( const point_2d & pt , const circle & c )
public static Point2D Geometry . DistantPointOnCircle (Point2D pt, Circle c);
public static Point2D SplashKit . DistantPointOnCircle (Point2D pt, Circle c);
def distant_point_on_circle ( pt , c ) :
function DistantPointOnCircle ( const pt: Point2D; const c: Circle): Point2D
Determines the opposite side of a circle given a collision point and a heading.
Parameters:
Name Type Description pt Point 2d
The point from which the test is being made c Circle
The circle heading Vector 2d
The direction the point is heading opposite_pt Point 2d
After the call, this is set to the point on the opposite side of the circle from pt when it is heading in the given direction.
Return Type: Boolean
Signatures:
bool distant_point_on_circle_heading ( const point_2d & pt , const circle & c , const vector_2d & heading , point_2d & opposite_pt )
public static bool Geometry . DistantPointOnCircleHeading (Point2D pt, Circle c, Vector2D heading, ref Point2D oppositePt);
public static bool SplashKit . DistantPointOnCircleHeading (Point2D pt, Circle c, Vector2D heading, ref Point2D oppositePt);
def distant_point_on_circle_heading ( pt , c , heading , opposite_pt ) :
function DistantPointOnCircleHeading ( const pt: Point2D; const c: Circle; const heading: Vector2D; var oppositePt: Point2D): Boolean
Calculates the distance from a ray cast from a point to a given circle.
Parameters:
Name Type Description ray_origin Point 2d
The origin of the ray ray_heading Vector 2d
The direction of the ray c Circle
The circle being tested
Return Type: Float
Signatures:
float ray_circle_intersect_distance ( const point_2d & ray_origin , const vector_2d & ray_heading , const circle & c )
public static float Geometry . RayCircleIntersectDistance (Point2D rayOrigin, Vector2D rayHeading, Circle c);
public static float SplashKit . RayCircleIntersectDistance (Point2D rayOrigin, Vector2D rayHeading, Circle c);
def ray_circle_intersect_distance ( ray_origin , ray_heading , c ) :
function RayCircleIntersectDistance ( const rayOrigin: Point2D; const rayHeading: Vector2D; const c: Circle): Single
Returns the two tangent points on the circle given the indicated point.
Parameters:
Name Type Description from_pt Point 2d
The source point c Circle
The circle p1 Point 2d
If this returns true, then p1
contains one of the points p2 Point 2d
If this returns true, then p2
contains one of the points
Return Type: Boolean
Signatures:
bool tangent_points ( const point_2d & from_pt , const circle & c , point_2d & p1 , point_2d & p2 )
public static bool Geometry . TangentPoints (Point2D fromPt, Circle c, ref Point2D p1, ref Point2D p2);
public static bool SplashKit . TangentPoints (Point2D fromPt, Circle c, ref Point2D p1, ref Point2D p2);
def tangent_points ( from_pt , c , p1 , p2 ) :
function TangentPoints ( const fromPt: Point2D; const c: Circle; var p1: Point2D; var p2: Point2D): Boolean
Calculates the two points on a circles radius that lie along the given vector. This represents the points on the circle when the vector is placed at the circle’s center point.
Parameters:
Name Type Description c Circle
The circle along Vector 2d
The vector representing the line along which the points lie. pt1 Point 2d
After the call, this is set to one of the widest points pt2 Point 2d
After the call, this is set to one of the widest points
Signatures:
void widest_points ( const circle & c , const vector_2d & along , point_2d & pt1 , point_2d & pt2 )
public static void Geometry . WidestPoints (Circle c, Vector2D along, ref Point2D pt1, ref Point2D pt2);
public static void SplashKit . WidestPoints (Circle c, Vector2D along, ref Point2D pt1, ref Point2D pt2);
def widest_points ( c , along , pt1 , pt2 ) :
procedure WidestPoints ( const c: Circle; const along: Vector2D; var pt1: Point2D; var pt2: Point2D)
Returns the cosine of the supplied angle (in degrees).
Parameters:
Name Type Description degrees Float
The angle in degrees
Return Type: Float
Signatures:
float cosine ( float degrees )
public static float Geometry . Cosine ( float degrees);
public static float SplashKit . Cosine ( float degrees);
function Cosine (degrees: Single ): Single
Returns the sine of the supplied angle (in degrees).
Parameters:
Name Type Description degrees Float
The angle in degrees
Return Type: Float
Signatures:
float sine ( float degrees )
public static float Geometry . Sine ( float degrees);
public static float SplashKit . Sine ( float degrees);
function Sine (degrees: Single ): Single
Returns the tangent of the supplied angle (in degrees).
Parameters:
Name Type Description degrees Float
The angle in degrees
Return Type: Float
Signatures:
float tangent ( float degrees )
public static float Geometry . Tangent ( float degrees);
public static float SplashKit . Tangent ( float degrees);
function Tangent (degrees: Single ): Single
Gets the closest point on the line to a given point.
Parameters:
Name Type Description from_pt Point 2d
The point to test (usually somewhere near the line) l Line
The line
Return Type: Point 2d
Signatures:
point_2d closest_point_on_line ( const point_2d from_pt , const line & l )
public static Point2D Geometry . ClosestPointOnLine (Point2D fromPt, Line l);
public static Point2D SplashKit . ClosestPointOnLine (Point2D fromPt, Line l);
def closest_point_on_line ( from_pt , l ) :
function ClosestPointOnLine (fromPt: Point2D; const l: Line): Point2D
Get the point closest to from pt
that is on one of the supplied lines.
Parameters:
Name Type Description from_pt Point 2d
The point to test lines Vector
The lines to check line_idx Integer
After the call this will store the index of the line that had the matching point.
Return Type: Point 2d
Signatures:
point_2d closest_point_on_lines ( const point_2d from_pt , const vector<line> & lines , int & line_idx )
public static Point2D Geometry . ClosestPointOnLines (Point2D fromPt, List < Line > lines, ref int lineIdx);
public static Point2D SplashKit . ClosestPointOnLines (Point2D fromPt, List < Line > lines, ref int lineIdx);
def closest_point_on_lines ( from_pt , lines , line_idx ) :
function ClosestPointOnLines (fromPt: Point2D; const lines: ArrayOfLine; var lineIdx: Integer ): Point2D
Create a line from one point to another.
Parameters:
Name Type Description start Point 2d
The start of the line end_pt Point 2d
The end of the line
Return Type: Line
Signatures:
line line_from ( const point_2d & start, const point_2d & end_pt)
public static Line Geometry . LineFrom (Point2D start, Point2D endPt);
public static Line SplashKit . LineFrom (Point2D start, Point2D endPt);
def line_from_point_to_point ( start , end_pt ) :
function LineFrom ( const start: Point2D; const endPt: Point2D): Line
Creates a line that starts at a point, and follows a given vector.
Parameters:
Name Type Description start Point 2d
The start of the line offset Vector 2d
The offset to the end of the line
Return Type: Line
Signatures:
line line_from ( const point_2d & start, const vector_2d & offset)
public static Line Geometry . LineFrom (Point2D start, Vector2D offset);
public static Line SplashKit . LineFrom (Point2D start, Vector2D offset);
def line_from_start_with_offset ( start , offset ) :
function LineFrom ( const start: Point2D; const offset: Vector2D): Line
Gets a line that goes from the origin and ends at the end of the vector.
Parameters:
Name Type Description v Vector 2d
The offset from the origin for the end of the line
Return Type: Line
Signatures:
line line_from ( const vector_2d & v)
public static Line Geometry . LineFrom (Vector2D v);
public static Line SplashKit . LineFrom (Vector2D v);
function LineFrom ( const v: Vector2D): Line
Create a line from one point to another.
Parameters:
Name Type Description x1 Double
The x value of the start of the line y1 Double
The y value of the start of the line x2 Double
The x value of the end of the line y2 Double
The y value of the end of the line
Return Type: Line
Signatures:
line line_from ( double x1, double y1, double x2, double y2)
public static Line Geometry . LineFrom ( double x1, double y1, double x2, double y2);
public static Line SplashKit . LineFrom ( double x1, double y1, double x2, double y2);
def line_from ( x1 , y1 , x2 , y2 ) :
function LineFrom (x1: Double ; y1: Double ; x2: Double ; y2: Double ): Line
Returns the point at which two lines would intersect. This point may lie past the end of one or both lines.
Parameters:
Name Type Description line1 Line
The first line line2 Line
The other line pt Point 2d
The resulting point where they intersect
Return Type: Boolean
Signatures:
bool line_intersection_point ( const line & line1 , const line & line2 , point_2d & pt )
public static bool Geometry . LineIntersectionPoint (Line line1, Line line2, ref Point2D pt);
public static bool SplashKit . LineIntersectionPoint (Line line1, Line line2, ref Point2D pt);
def line_intersection_point ( line1 , line2 , pt ) :
function LineIntersectionPoint ( const line1: Line; const line2: Line; var pt: Point2D): Boolean
Returns true if the line intersects the circle.
Parameters:
Return Type: Boolean
Signatures:
bool line_intersects_circle ( const line & l , const circle & c )
public static bool Geometry . LineIntersectsCircle (Line l, Circle c);
public static bool SplashKit . LineIntersectsCircle (Line l, Circle c);
def line_intersects_circle ( l , c ) :
function LineIntersectsCircle ( const l: Line; const c: Circle): Boolean
Returns true if the line intersects any of the lines.
Parameters:
Name Type Description l Line
The line to check lines Vector
The lines to check against
Return Type: Boolean
Signatures:
bool line_intersects_lines ( const line & l , const vector<line> & lines )
public static bool Geometry . LineIntersectsLines (Line l, List < Line > lines);
public static bool SplashKit . LineIntersectsLines (Line l, List < Line > lines);
def line_intersects_lines ( l , lines ) :
function LineIntersectsLines ( const l: Line; const lines: ArrayOfLine): Boolean
Returns true if the line intersects the rectangle.
Parameters:
Return Type: Boolean
Signatures:
bool line_intersects_rect ( const line & l , const rectangle & rect )
public static bool Geometry . LineIntersectsRect (Line l, Rectangle rect);
public static bool SplashKit . LineIntersectsRect (Line l, Rectangle rect);
def line_intersects_rect ( l , rect ) :
function LineIntersectsRect ( const l: Line; const rect: Rectangle): Boolean
Returns the length of a line.
Parameters:
Name Type Description l Line
The line
Return Type: Float
Signatures:
float line_length ( const line & l )
public static float Geometry . LineLength (Line l);
public static float SplashKit . LineLength (Line l);
function LineLength ( const l: Line): Single
Returns the squared length of the line. You can also get the Line Length
.
Parameters:
Name Type Description l Line
The line
Return Type: Float
Signatures:
float line_length_squared ( const line & l )
public static float Geometry . LineLengthSquared (Line l);
public static float SplashKit . LineLengthSquared (Line l);
def line_length_squared ( l ) :
function LineLengthSquared ( const l: Line): Single
Returns the center point of the line.
Parameters:
Name Type Description l Line
The line
Return Type: Point 2d
Signatures:
point_2d line_mid_point ( const line & l )
public static Point2D Geometry . LineMidPoint (Line l);
public static Point2D SplashKit . LineMidPoint (Line l);
function LineMidPoint ( const l: Line): Point2D
The line normal (a perpendicular vector).
Parameters:
Name Type Description l Line
The line
Return Type: Vector 2d
Signatures:
vector_2d line_normal ( const line & l )
public static Vector2D Geometry . LineNormal (Line l);
public static Vector2D SplashKit . LineNormal (Line l);
function LineNormal ( const l: Line): Vector2D
Returns a text description of the line.
Parameters:
Name Type Description ln Line
The line
Return Type: String
Signatures:
string line_to_string ( const line & ln )
public static string Geometry . LineToString (Line ln);
public static string SplashKit . LineToString (Line ln);
function LineToString ( const ln: Line): String
Returns an array of lines from a supplied rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle to get the lines from
Return Type: Vector
Signatures:
vector<line> lines_from ( const rectangle & rect )
public static List < Line > Geometry . LinesFrom (Rectangle rect);
public static List < Line > SplashKit . LinesFrom (Rectangle rect);
def lines_from_rectangle ( rect ) :
function LinesFrom ( const rect: Rectangle): ArrayOfLine
Returns an array of lines from the details in the triangle.
Parameters:
Name Type Description t Triangle
The triangle
Return Type: Vector
Signatures:
vector<line> lines_from ( const triangle & t )
public static List < Line > Geometry . LinesFrom (Triangle t);
public static List < Line > SplashKit . LinesFrom (Triangle t);
def lines_from_triangle ( t ) :
function LinesFrom ( const t: Triangle): ArrayOfLine
Returns true if the two lines intersect.
Parameters:
Name Type Description l1 Line
The first line l2 Line
The other line
Return Type: Boolean
Signatures:
bool lines_intersect ( const line & l1 , const line & l2 )
public static bool Geometry . LinesIntersect (Line l1, Line l2);
public static bool SplashKit . LinesIntersect (Line l1, Line l2);
def lines_intersect ( l1 , l2 ) :
function LinesIntersect ( const l1: Line; const l2: Line): Boolean
Returns a point at the given location.
Parameters:
Name Type Description x Double
The x value of the coordinate y Double
The y value of the coordinate
Return Type: Point 2d
Signatures:
point_2d point_at ( double x , double y )
public static Point2D Geometry . PointAt ( double x, double y);
public static Point2D SplashKit . PointAt ( double x, double y);
function PointAt (x: Double ; y: Double ): Point2D
Returns a point representing the origin.
Return Type: Point 2d
Signatures:
point_2d point_at_origin ()
public static Point2D Geometry . PointAtOrigin ();
public static Point2D SplashKit . PointAtOrigin ();
function PointAtOrigin (): Point2D
Returns true if the point pt
is in the circle c
.
Parameters:
Name Type Description pt Point 2d
The point to test c Circle
The circle to check
Return Type: Boolean
Signatures:
bool point_in_circle ( const point_2d & pt , const circle & c )
public static bool Geometry . PointInCircle (Point2D pt, Circle c);
public static bool SplashKit . PointInCircle (Point2D pt, Circle c);
def point_in_circle ( pt , c ) :
function PointInCircle ( const pt: Point2D; const c: Circle): Boolean
Return true if the point is in the circle.
Parameters:
Name Type Description ptx Double
the x value of the point pty Double
the y value of the point cx Double
the x value of the centre of the circle cy Double
the y value of the centre of the circle radius Double
the radius of the circle
Return Type: Boolean
Signatures:
bool point_in_circle ( double ptx , double pty , double cx , double cy , double radius )
public static bool Geometry . PointInCircle ( double ptx, double pty, double cx, double cy, double radius);
public static bool SplashKit . PointInCircle ( double ptx, double pty, double cx, double cy, double radius);
def point_in_circle_with_values ( ptx , pty , cx , cy , radius ) :
function PointInCircle (ptx: Double ; pty: Double ; cx: Double ; cy: Double ; radius: Double ): Boolean
Tests if a point is in a quad.
Parameters:
Name Type Description pt Point 2d
The point to test. q Quad
The quad to check if the point is within.
Return Type: Boolean
Signatures:
bool point_in_quad ( const point_2d & pt , const quad & q )
public static bool Geometry . PointInQuad (Point2D pt, Quad q);
public static bool SplashKit . PointInQuad (Point2D pt, Quad q);
def point_in_quad ( pt , q ) :
function PointInQuad ( const pt: Point2D; const q: Quad): Boolean
Returns true if point pt
is in the Rectangle rect
.
Parameters:
Return Type: Boolean
Signatures:
bool point_in_rectangle ( const point_2d & pt , const rectangle & rect )
public static bool Geometry . PointInRectangle (Point2D pt, Rectangle rect);
public static bool SplashKit . PointInRectangle (Point2D pt, Rectangle rect);
def point_in_rectangle ( pt , rect ) :
function PointInRectangle ( const pt: Point2D; const rect: Rectangle): Boolean
Returns true if the point is within the bounds of a Rectangle.
Parameters:
Name Type Description ptx Double
the x value of the point pty Double
the y value of the point rect_x Double
x value of the rectangle rect_y Double
y value of the rectangle rect_width Double
width of the rectangle rect_height Double
height of the rectangle
Return Type: Boolean
Signatures:
bool point_in_rectangle ( double ptx , double pty , double rect_x , double rect_y , double rect_width , double rect_height )
public static bool Geometry . PointInRectangle ( double ptx, double pty, double rectX, double rectY, double rectWidth, double rectHeight);
public static bool SplashKit . PointInRectangle ( double ptx, double pty, double rectX, double rectY, double rectWidth, double rectHeight);
def point_in_rectangle_with_values ( ptx , pty , rect_x , rect_y , rect_width , rect_height ) :
function PointInRectangle (ptx: Double ; pty: Double ; rectX: Double ; rectY: Double ; rectWidth: Double ; rectHeight: Double ): Boolean
Returns true if the point pt
is in the Triangle tri
.
Parameters:
Return Type: Boolean
Signatures:
bool point_in_triangle ( const point_2d & pt , const triangle & tri )
public static bool Geometry . PointInTriangle (Point2D pt, Triangle tri);
public static bool SplashKit . PointInTriangle (Point2D pt, Triangle tri);
def point_in_triangle ( pt , tri ) :
function PointInTriangle ( const pt: Point2D; const tri: Triangle): Boolean
Returns the distance from a point to a line.
Parameters:
Return Type: Float
Signatures:
float point_line_distance ( const point_2d & pt , const line & l )
public static float Geometry . PointLineDistance (Point2D pt, Line l);
public static float SplashKit . PointLineDistance (Point2D pt, Line l);
def point_line_distance ( pt , l ) :
function PointLineDistance ( const pt: Point2D; const l: Line): Single
Calculate the Point 2d
that is offset from the start_point
by the offset
Parameters:
Name Type Description start_point Point 2d
The starting point offset Vector 2d
The distance and direction to move
Return Type: Point 2d
Signatures:
point_2d point_offset_by ( const point_2d & start_point , const vector_2d & offset )
public static Point2D Geometry . PointOffsetBy (Point2D startPoint, Vector2D offset);
public static Point2D SplashKit . PointOffsetBy (Point2D startPoint, Vector2D offset);
def point_offset_by ( start_point , offset ) :
function PointOffsetBy ( const startPoint: Point2D; const offset: Vector2D): Point2D
Returns the point offset from the origin by the provided vector.
Parameters:
Name Type Description offset Vector 2d
The distance and direction to move
Return Type: Point 2d
Signatures:
point_2d point_offset_from_origin ( const vector_2d & offset )
public static Point2D Geometry . PointOffsetFromOrigin (Vector2D offset);
public static Point2D SplashKit . PointOffsetFromOrigin (Vector2D offset);
def point_offset_from_origin ( offset ) :
function PointOffsetFromOrigin ( const offset: Vector2D): Point2D
Returns true if point pt
is on the line l
.
Parameters:
Name Type Description pt Point 2d
The point to test l Line
The line to check
Return Type: Boolean
Signatures:
bool point_on_line ( const point_2d & pt , const line & l )
public static bool Geometry . PointOnLine (Point2D pt, Line l);
public static bool SplashKit . PointOnLine (Point2D pt, Line l);
def point_on_line ( pt , l ) :
function PointOnLine ( const pt: Point2D; const l: Line): Boolean
Returns true when the point pt
is on the line l
. The proximity value is used to set the sensitivity — higher values effectively make the line thicker.
Parameters:
Name Type Description pt Point 2d
The point to test l Line
The line to check proximity Float
The sensitivity to allow close approximities
Return Type: Boolean
Signatures:
bool point_on_line ( const point_2d & pt , const line & l , float proximity )
public static bool Geometry . PointOnLine (Point2D pt, Line l, float proximity);
public static bool SplashKit . PointOnLine (Point2D pt, Line l, float proximity);
def point_on_line_with_proximity ( pt , l , proximity ) :
function PointOnLine ( const pt: Point2D; const l: Line; proximity: Single ): Boolean
Returns the angle between two points in degrees.
Parameters:
Return Type: Float
Signatures:
float point_point_angle ( const point_2d & pt1 , const point_2d & pt2 )
public static float Geometry . PointPointAngle (Point2D pt1, Point2D pt2);
public static float SplashKit . PointPointAngle (Point2D pt1, Point2D pt2);
def point_point_angle ( pt1 , pt2 ) :
function PointPointAngle ( const pt1: Point2D; const pt2: Point2D): Single
Returns the distance between two points.
Parameters:
Return Type: Float
Signatures:
float point_point_distance ( const point_2d & pt1 , const point_2d & pt2 )
public static float Geometry . PointPointDistance (Point2D pt1, Point2D pt2);
public static float SplashKit . PointPointDistance (Point2D pt1, Point2D pt2);
def point_point_distance ( pt1 , pt2 ) :
function PointPointDistance ( const pt1: Point2D; const pt2: Point2D): Single
Get a text description of the Point 2d
.
Parameters:
Name Type Description pt Point 2d
The point details
Return Type: String
Signatures:
string point_to_string ( const point_2d & pt )
public static string Geometry . PointToString (Point2D pt);
public static string SplashKit . PointToString (Point2D pt);
function PointToString ( const pt: Point2D): String
Returns a random point within the bounds of the bitmap.
Parameters:
Name Type Description bmp Bitmap
The bitmap
Return Type: Point 2d
Signatures:
point_2d random_bitmap_point (bitmap bmp )
public static Point2D Geometry . RandomBitmapPoint (Bitmap bmp);
public static Point2D SplashKit . RandomBitmapPoint (Bitmap bmp);
def random_bitmap_point ( bmp ) :
function RandomBitmapPoint (bmp: Bitmap): Point2D
Returns a random point on the current window.
Return Type: Point 2d
Signatures:
point_2d random_screen_point ()
public static Point2D Geometry . RandomScreenPoint ();
public static Point2D SplashKit . RandomScreenPoint ();
def random_screen_point () :
function RandomScreenPoint (): Point2D
Returns a random point on the provided window.
Parameters:
Name Type Description wind Window
The window
Return Type: Point 2d
Signatures:
point_2d random_window_point (window wind )
public static Point2D Geometry . RandomWindowPoint (Window wind);
public static Point2D SplashKit . RandomWindowPoint (Window wind);
def random_window_point ( wind ) :
function RandomWindowPoint (wind: Window): Point2D
Returns True of pt1
is at the same point as pt2
. This checks at an integer level, indicating the two points refer to the same pixel.
Parameters:
Return Type: Boolean
Signatures:
bool same_point ( const point_2d & pt1 , const point_2d & pt2 )
public static bool Geometry . SamePoint (Point2D pt1, Point2D pt2);
public static bool SplashKit . SamePoint (Point2D pt1, Point2D pt2);
def same_point ( pt1 , pt2 ) :
function SamePoint ( const pt1: Point2D; const pt2: Point2D): Boolean
Returns a quad from the passed in points.
Parameters:
Name Type Description p1 Point 2d
The top left of the quad. p2 Point 2d
The top right of the quad p3 Point 2d
The bottom left of the quad p4 Point 2d
The bottom right of the quad
Return Type: Quad
Signatures:
quad quad_from ( const point_2d & p1 , const point_2d & p2 , const point_2d & p3 , const point_2d & p4 )
public static Quad Geometry . QuadFrom (Point2D p1, Point2D p2, Point2D p3, Point2D p4);
public static Quad SplashKit . QuadFrom (Point2D p1, Point2D p2, Point2D p3, Point2D p4);
def quad_from_points ( p1 , p2 , p3 , p4 ) :
function QuadFrom ( const p1: Point2D; const p2: Point2D; const p3: Point2D; const p4: Point2D): Quad
Returns a quad from the x-y points of a given recatangle
Parameters:
Name Type Description rect Rectangle
The rectangle to convert to a quad
Return Type: Quad
Signatures:
quad quad_from ( const rectangle & rect )
public static Quad Geometry . QuadFrom (Rectangle rect);
public static Quad SplashKit . QuadFrom (Rectangle rect);
def quad_from_rectangle ( rect ) :
function QuadFrom ( const rect: Rectangle): Quad
Returns a quad from the rectangle, then applies the transformation to the quads points.
Parameters:
Name Type Description rect Rectangle
The rectangle to transform to a quad. transform Matrix 2d
A transform to apply to the resulting quad.
Return Type: Quad
Signatures:
quad quad_from ( const rectangle & rect , const matrix_2d & transform )
public static Quad Geometry . QuadFrom (Rectangle rect, Matrix2D transform);
public static Quad SplashKit . QuadFrom (Rectangle rect, Matrix2D transform);
def quad_from_rectangle_with_transformation ( rect , transform ) :
function QuadFrom ( const rect: Rectangle; const transform: Matrix2D): Quad
Returns a quad for the passed in x & y points.
Parameters:
Name Type Description x_top_left Double
X coordinate of the top left of the quad y_top_left Double
Y coordinate of the top left of the quad x_top_right Double
X coordinate of the top right of the quad y_top_right Double
Y coordinate of the top right of the quad x_bottom_left Double
X coordinate of the bottom left of the quad y_bottom_left Double
Y coordinate of the bottom left of the quad x_bottom_right Double
X coordinate of the bottom right of the quad y_bottom_right Double
Y coordinate of the bottom right of the quad
Return Type: Quad
Signatures:
quad quad_from ( double x_top_left , double y_top_left , double x_top_right , double y_top_right , double x_bottom_left , double y_bottom_left , double x_bottom_right , double y_bottom_right )
public static Quad Geometry . QuadFrom ( double xTopLeft, double yTopLeft, double xTopRight, double yTopRight, double xBottomLeft, double yBottomLeft, double xBottomRight, double yBottomRight);
public static Quad SplashKit . QuadFrom ( double xTopLeft, double yTopLeft, double xTopRight, double yTopRight, double xBottomLeft, double yBottomLeft, double xBottomRight, double yBottomRight);
def quad_from ( x_top_left , y_top_left , x_top_right , y_top_right , x_bottom_left , y_bottom_left , x_bottom_right , y_bottom_right ) :
function QuadFrom (xTopLeft: Double ; yTopLeft: Double ; xTopRight: Double ; yTopRight: Double ; xBottomLeft: Double ; yBottomLeft: Double ; xBottomRight: Double ; yBottomRight: Double ): Quad
Returns true if two quads intersect.
Parameters:
Name Type Description q1 Quad
The first quad q2 Quad
The second quad
Return Type: Boolean
Signatures:
bool quads_intersect ( const quad & q1 , const quad & q2 )
public static bool Geometry . QuadsIntersect (Quad q1, Quad q2);
public static bool SplashKit . QuadsIntersect (Quad q1, Quad q2);
def quads_intersect ( q1 , q2 ) :
function QuadsIntersect ( const q1: Quad; const q2: Quad): Boolean
Change a point in a quad.
Parameters:
Name Type Description q Quad
The quad to change idx Integer
The index of the point: 0 is top left, 1 is top right, 2 is bottom left, and 3 is bottom right value Point 2d
The new value for that point in the quad
Signatures:
void set_quad_point (quad & q , int idx , const point_2d & value )
public static void Geometry . SetQuadPoint ( ref Quad q, int idx, Point2D value );
public static void SplashKit . SetQuadPoint ( ref Quad q, int idx, Point2D value );
def set_quad_point ( q , idx , value ) :
procedure SetQuadPoint ( var q: Quad; idx: Integer ; const value: Point2D)
Returns the two triangles that make up a quad in a vector.
Parameters:
Name Type Description q Quad
The quad
Return Type: Vector
Signatures:
vector<triangle> triangles_from ( const quad & q )
public static List < Triangle > Geometry . TrianglesFrom (Quad q);
public static List < Triangle > SplashKit . TrianglesFrom (Quad q);
function TrianglesFrom ( const q: Quad): ArrayOfTriangle
Return a rectangle that is inset an amount from a given rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle to inset inset_amount Float
The amount to inset the rectangle
Return Type: Rectangle
Signatures:
rectangle inset_rectangle ( const rectangle & rect , float inset_amount )
public static Rectangle Geometry . InsetRectangle (Rectangle rect, float insetAmount);
public static Rectangle SplashKit . InsetRectangle (Rectangle rect, float insetAmount);
def inset_rectangle ( rect , inset_amount ) :
function InsetRectangle ( const rect: Rectangle; insetAmount: Single ): Rectangle
Returns a rectangle that represents the intersection of two rectangles.
Parameters:
Return Type: Rectangle
Signatures:
rectangle intersection ( const rectangle & rect1 , const rectangle & rect2 )
public static Rectangle Geometry . Intersection (Rectangle rect1, Rectangle rect2);
public static Rectangle SplashKit . Intersection (Rectangle rect1, Rectangle rect2);
def intersection ( rect1 , rect2 ) :
function Intersection ( const rect1: Rectangle; const rect2: Rectangle): Rectangle
Returns a rectangle that surrounds a given circle
Parameters:
Name Type Description c Circle
The circle
Return Type: Rectangle
Signatures:
rectangle rectangle_around ( const circle & c )
public static Rectangle Geometry . RectangleAround (Circle c);
public static Rectangle SplashKit . RectangleAround (Circle c);
def rectangle_around_circle ( c ) :
function RectangleAround ( const c: Circle): Rectangle
Returns a rectangle that surrounds a given line segment
Parameters:
Name Type Description l Line
The line
Return Type: Rectangle
Signatures:
rectangle rectangle_around ( const line & l )
public static Rectangle Geometry . RectangleAround (Line l);
public static Rectangle SplashKit . RectangleAround (Line l);
def rectangle_around_line ( l ) :
function RectangleAround ( const l: Line): Rectangle
Returns a rectangle that surrounds a given quad.
Parameters:
Name Type Description q Quad
The quad
Return Type: Rectangle
Signatures:
rectangle rectangle_around ( const quad & q )
public static Rectangle Geometry . RectangleAround (Quad q);
public static Rectangle SplashKit . RectangleAround (Quad q);
def rectangle_around_quad ( q ) :
function RectangleAround ( const q: Quad): Rectangle
Returns a rectangle that surrounds a given triangle
Parameters:
Name Type Description t Triangle
The triangle
Return Type: Rectangle
Signatures:
rectangle rectangle_around ( const triangle & t )
public static Rectangle Geometry . RectangleAround (Triangle t);
public static Rectangle SplashKit . RectangleAround (Triangle t);
def rectangle_around_triangle ( t ) :
function RectangleAround ( const t: Triangle): Rectangle
The location of the bottom of the rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle.
Return Type: Float
Signatures:
float rectangle_bottom ( const rectangle & rect )
public static float Geometry . RectangleBottom (Rectangle rect);
public static float SplashKit . RectangleBottom (Rectangle rect);
def rectangle_bottom ( rect ) :
function RectangleBottom ( const rect: Rectangle): Single
Returns the center point of a given rectangle
Parameters:
Name Type Description rect Rectangle
The rectangle
Return Type: Point 2d
Signatures:
point_2d rectangle_center ( const rectangle & rect )
public static Point2D Geometry . RectangleCenter (Rectangle rect);
public static Point2D SplashKit . RectangleCenter (Rectangle rect);
def rectangle_center ( rect ) :
function RectangleCenter ( const rect: Rectangle): Point2D
Returns a rectangle at the specified point with a given width and height
Parameters:
Name Type Description pt Point 2d
The origin for the rectangle width Double
Its width height Double
Its height
Return Type: Rectangle
Signatures:
rectangle rectangle_from ( const point_2d pt , const double width , const double height )
public static Rectangle Geometry . RectangleFrom (Point2D pt, double width, double height);
public static Rectangle SplashKit . RectangleFrom (Point2D pt, double width, double height);
def rectangle_from_point_and_size ( pt , width , height ) :
function RectangleFrom (pt: Point2D; width: Double ; height: Double ): Rectangle
Returns a rectangle with pt1 and pt2 defining the two distant edge points.
Parameters:
Return Type: Rectangle
Signatures:
rectangle rectangle_from ( const point_2d pt1 , const point_2d pt2 )
public static Rectangle Geometry . RectangleFrom (Point2D pt1, Point2D pt2);
public static Rectangle SplashKit . RectangleFrom (Point2D pt1, Point2D pt2);
def rectangle_from_points ( pt1 , pt2 ) :
function RectangleFrom (pt1: Point2D; pt2: Point2D): Rectangle
Returns a rectangle from a given x,y location with the specified width and height.
Parameters:
Name Type Description x Double
The x coordinate of the rectangle y Double
The y coordinate of the rectangle width Double
The width of the rectangle height Double
The height of the rectangle
Return Type: Rectangle
Signatures:
rectangle rectangle_from ( double x , double y , double width , double height )
public static Rectangle Geometry . RectangleFrom ( double x, double y, double width, double height);
public static Rectangle SplashKit . RectangleFrom ( double x, double y, double width, double height);
def rectangle_from ( x , y , width , height ) :
function RectangleFrom (x: Double ; y: Double ; width: Double ; height: Double ): Rectangle
The location of the left edge of the rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle.
Return Type: Float
Signatures:
float rectangle_left ( const rectangle & rect )
public static float Geometry . RectangleLeft (Rectangle rect);
public static float SplashKit . RectangleLeft (Rectangle rect);
def rectangle_left ( rect ) :
function RectangleLeft ( const rect: Rectangle): Single
Returns a rectangle that is moved by the provided vector.
Parameters:
Name Type Description rect Rectangle
The original rectangle offset Vector 2d
The amount and direction for the rectangle to move
Return Type: Rectangle
Signatures:
rectangle rectangle_offset_by ( const rectangle & rect , const vector_2d & offset )
public static Rectangle Geometry . RectangleOffsetBy (Rectangle rect, Vector2D offset);
public static Rectangle SplashKit . RectangleOffsetBy (Rectangle rect, Vector2D offset);
def rectangle_offset_by ( rect , offset ) :
function RectangleOffsetBy ( const rect: Rectangle; const offset: Vector2D): Rectangle
The location of the right edge of the rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle.
Return Type: Float
Signatures:
float rectangle_right ( const rectangle & rect )
public static float Geometry . RectangleRight (Rectangle rect);
public static float SplashKit . RectangleRight (Rectangle rect);
def rectangle_right ( rect ) :
function RectangleRight ( const rect: Rectangle): Single
Get a text representation of the passed in rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle
Return Type: String
Signatures:
string rectangle_to_string ( const rectangle & rect )
public static string Geometry . RectangleToString (Rectangle rect);
public static string SplashKit . RectangleToString (Rectangle rect);
def rectangle_to_string ( rect ) :
function RectangleToString ( const rect: Rectangle): String
The top of the rectangle.
Parameters:
Name Type Description rect Rectangle
The rectangle.
Return Type: Float
Signatures:
float rectangle_top ( const rectangle & rect )
public static float Geometry . RectangleTop (Rectangle rect);
public static float SplashKit . RectangleTop (Rectangle rect);
function RectangleTop ( const rect: Rectangle): Single
Returns true if the two rectangles intersect.
Parameters:
Return Type: Boolean
Signatures:
bool rectangles_intersect ( const rectangle & rect1 , const rectangle & rect2 )
public static bool Geometry . RectanglesIntersect (Rectangle rect1, Rectangle rect2);
public static bool SplashKit . RectanglesIntersect (Rectangle rect1, Rectangle rect2);
def rectangles_intersect ( rect1 , rect2 ) :
function RectanglesIntersect ( const rect1: Rectangle; const rect2: Rectangle): Boolean
Return the barycenter of the triangle. This is one way of calculating the center point of a triangle.
Parameters:
Name Type Description tri Triangle
The triangle to get the center of
Return Type: Point 2d
Signatures:
point_2d triangle_barycenter ( const triangle & tri )
public static Point2D Geometry . TriangleBarycenter (Triangle tri);
public static Point2D SplashKit . TriangleBarycenter (Triangle tri);
def triangle_barycenter ( tri ) :
function TriangleBarycenter ( const tri: Triangle): Point2D
Generate a triangle from a set of points.
Parameters:
Name Type Description p1 Point 2d
The first point of the triangle p2 Point 2d
The second point of the triangle p3 Point 2d
The third point of the triangle
Return Type: Triangle
Signatures:
triangle triangle_from ( const point_2d & p1 , const point_2d & p2 , const point_2d & p3 )
public static Triangle Geometry . TriangleFrom (Point2D p1, Point2D p2, Point2D p3);
public static Triangle SplashKit . TriangleFrom (Point2D p1, Point2D p2, Point2D p3);
def triangle_from ( p1 , p2 , p3 ) :
function TriangleFrom ( const p1: Point2D; const p2: Point2D; const p3: Point2D): Triangle
Generate a triangle from a set of points.
Parameters:
Name Type Description x1 Double
The x coordinate for the first point y1 Double
The y coordinate for the first point x2 Double
The x coordinate for the second point y2 Double
The y coordinate for the second point x3 Double
The x coordinate for the third point y3 Double
The y coordinate for the third point
Return Type: Triangle
Signatures:
triangle triangle_from ( double x1 , double y1 , double x2 , double y2 , double x3 , double y3 )
public static Triangle Geometry . TriangleFrom ( double x1, double y1, double x2, double y2, double x3, double y3);
public static Triangle SplashKit . TriangleFrom ( double x1, double y1, double x2, double y2, double x3, double y3);
def triangle_from__from_coordinates ( x1 , y1 , x2 , y2 , x3 , y3 ) :
function TriangleFrom (x1: Double ; y1: Double ; x2: Double ; y2: Double ; x3: Double ; y3: Double ): Triangle
Returns true if the triangle intersects with the rectangle.
Parameters:
Return Type: Boolean
Signatures:
bool triangle_rectangle_intersect ( const triangle & tri , const rectangle & rect )
public static bool Geometry . TriangleRectangleIntersect (Triangle tri, Rectangle rect);
public static bool SplashKit . TriangleRectangleIntersect (Triangle tri, Rectangle rect);
def triangle_rectangle_intersect ( tri , rect ) :
function TriangleRectangleIntersect ( const tri: Triangle; const rect: Rectangle): Boolean
Returns a text description of the triangle.
Parameters:
Name Type Description tri Triangle
The triangle
Return Type: String
Signatures:
string triangle_to_string ( const triangle & tri )
public static string Geometry . TriangleToString (Triangle tri);
public static string SplashKit . TriangleToString (Triangle tri);
def triangle_to_string ( tri ) :
function TriangleToString ( const tri: Triangle): String
Returns true if the two triangles intersect.
Parameters:
Return Type: Boolean
Signatures:
bool triangles_intersect ( const triangle & t1 , const triangle & t2 )
public static bool Geometry . TrianglesIntersect (Triangle t1, Triangle t2);
public static bool SplashKit . TrianglesIntersect (Triangle t1, Triangle t2);
def triangles_intersect ( t1 , t2 ) :
function TrianglesIntersect ( const t1: Triangle; const t2: Triangle): Boolean