Represents the union of a set of convexes.
Namespace: SphericalAssembly: SphericalLib (in SphericalLib.dll) Version: 1.0.5951.32246 (1.0.0.0)
Syntax
C# |
---|
[SerializableAttribute] public class Region |
Visual C++ |
---|
[SerializableAttribute] public ref class Region |
F# |
---|
[<SerializableAttribute>] type Region = class end |
Examples
The simple example below demonstrates how to compute
the intersection and union of two great circles:
The output for this code is:
CopyC#
// The centers of the circles Cartesian x = new Cartesian(1, 0, 0, false); Cartesian y = new Cartesian(0, 1, 0, false); // The two great circles Halfspace hx = new Halfspace(x, 0); Halfspace hy = new Halfspace(y, 0); // The intersection of the two circles is a convex Convex c = new Convex(new Halfspace[] { hx, hy }); c.Simplify(); Console.Out.WriteLine("Area: {0}", c.Area); Console.Out.WriteLine(c); // The union of the circles is a region Region r = new Region(); r.Add(new Convex(hx)); r.Add(new Convex(hy)); r.Simplify(); Console.Out.WriteLine("Area: {0}", r.Area); Console.Out.WriteLine(r);
CopyC#
Area: 10313.2403123548 CONVEX 0 1 0 0 1 0 0 0 Area: 30939.7209370645 REGION CONVEX 0 1 0 0 CONVEX 0 -1 0 0 1 0 0 0
Inheritance Hierarchy
System..::..Object
Spherical..::..Region
Spherical..::..Region