GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
M_RECTANGLE(3) FreeBSD Library Functions Manual M_RECTANGLE(3)

M_RectangleAgar-Math rectangle structure

#include <agar/core.h>
#include <agar/gui.h>
#include <agar/math/m.h>

The M_Rectangle2 structure describes a rectangle in R^2 in terms of four points:

typedef struct m_rectangle2 {
	M_Vector2 a, b, c, d;
} M_Rectangle2;

Similarly, M_Rectangle3 describes a rectangle in R^3:

typedef struct m_rectangle3 {
	M_Vector3 a, b, c, d;
} M_Rectangle3;

M_Rectangle2
(M_Line2 L1, M_Line2 L2);


M_Rectangle3
(M_Line2 L1, M_Line2 L2, M_Line2 L3);


M_Rectangle2
(M_Vector2 a, M_Vector2 b);


M_Rectangle3
(M_Vector3 a, M_Vector3 b, M_Vector3 c);


M_Rectangle2
(AG_DataSource *ds);


M_Rectangle3
(AG_DataSource *ds);


void
(AG_DataSource *ds, M_Rectangle2 *R);


void
(AG_DataSource *ds, M_Rectangle3 *R);


M_Rectangle2
(M_Vector2 a, M_Vector2 b, M_Vector2 c);


M_Rectangle3
(M_Vector3 a, M_Vector3 b, M_Vector3 c);

The functions () and M_RectangleFromLines3() return an M_Rectangle2 or M_Rectangle3 describing a rectangle in terms of two or three lines.

() and M_RectangleFromPts3() return a rectangle in terms of two or three points.

The () and () functions read or write a rectangle structure from/to an AG_DataSource(3).

The macros () and M_RECTANGLE3_INITIALIZER() expand to static initializers for M_Rectangle2 and M_Rectangle3, respectively.

int
M_PointInRectangle2(M_Rectangle2 R, M_Vector2 p);


M_Real
(M_Rectangle2 R);


M_Real
(const M_Rectangle2 *R);


M_Real
(M_Rectangle2 R);


M_Real
(const M_Rectangle2 *R);


M_Real
(M_Rectangle3 R);


M_Real
(const M_Rectangle3 *R);


M_Real
(M_Rectangle3 R);


M_Real
(const M_Rectangle3 *R);

The () routine tests whether point p lies inside the rectangle R and returns 1 if it does, otherwise 0.

The () and () routines return the width and height of the rectangle.

AG_DataSource(3), AG_Intro(3), M_Circle(3), M_Geometry(3), M_Plane(3), M_Polygon(3), M_Rectangle(3), M_Sphere(3), M_Triangle(3), M_Vector(3)

The M_Rectangle structure first appeared in Agar 1.3.4.

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.