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_SPHERE(3) FreeBSD Library Functions Manual M_SPHERE(3)

M_SphereAgar-Math sphere structure

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

The M_Sphere structure describes a sphere in terms of an origin point p and a radius r:

typedef struct m_sphere {
	M_Vector3 p;
	M_Real r;
} M_Sphere;

M_Sphere
(M_Vector p, M_Real r);


M_Sphere
(AG_DataSource *ds);


void
(AG_DataSource *ds, M_Sphere *S);


M_Sphere
(M_Real x, M_Real y, M_Real z, M_Real r);

The () function returns a M_Sphere describing a sphere of radius r centered at point p.

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

The () macro expands to a static initializer for M_Sphere.

M_Real
M_SpherePointDistance(M_Sphere S, M_Vector3 p);


M_Real
(M_Sphere S);


M_Real
(M_Sphere S);

The () routine computes the minimal distance between a sphere S and a point p.

() returns the surface area of the sphere. M_SphereVolume() returns the volume of the interior of the sphere.

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_Sphere 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.