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_Circle
Agar-Math sphere structure

#include <agar/math.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_SphereFromPt(M_Vector p, M_Real r);


M_Sphere
M_SphereRead(AG_DataSource *ds);


void
M_SphereWrite(AG_DataSource *ds, M_Sphere *S);


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

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

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

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

M_Real
M_SpherePointDistance(M_Sphere S, M_Vector3 p);


M_Real
M_SphereSurfaceArea(M_Sphere S);


M_Real
M_SphereVolume(M_Sphere S);

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

M_SphereSurfaceArea() 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_Circle structure first appeared in Agar 1.3.4.
July 17, 2009 FreeBSD 13.1-RELEASE

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.