Sphere3D

Element

A sphere in a 3D view. A sphere consists of all points with a given distance from a given point. The given point is called the center, and the given distance is called the radius. A sphere can be constructed by providing a center and a point on the sphere or a center and a radius (given as a number or function). If the radius is a negative value, its absolute value is taken.

Usage (signatures)
board.create('sphere3d', [center, radius]);
Parameters
Name Type Description
center Point3DLike
radius NumberLike

If the radius is supplied as number or the output of a function, its absolute value is taken.

board.create('sphere3d', [center, point]);
Parameters
Name Type Description
center Point3DLike
point NumberLike

Point on sphere defining the radius.

Examples
var view = board.create(
    'view3d',
    [[-6, -3], [8, 8],
    [[0, 3], [0, 3], [0, 3]]],
    {
        xPlaneRear: {fillOpacity: 0.2, gradient: null},
        yPlaneRear: {fillOpacity: 0.2, gradient: null},
        zPlaneRear: {fillOpacity: 0.2, gradient: null}
    }
);

// Two points
var center = view.create(
    'point3d',
    [1.5, 1.5, 1.5],
    {
        withLabel: false,
        size: 5,
   }
);
var point = view.create(
    'point3d',
    [2, 1.5, 1.5],
    {
        withLabel: false,
        size: 5
   }
);

// Sphere
var sphere = view.create(
    'sphere3d',
    [center, point],
    {}
);

Glider on sphere

 var view = board.create(
     'view3d',
     [[-6, -3], [8, 8],
     [[-3, 3], [-3, 3], [-3, 3]]],
     {
         depthOrder: {
             enabled: true
         },
         projection: 'central',
         xPlaneRear: {fillOpacity: 0.2, gradient: null},
         yPlaneRear: {fillOpacity: 0.2, gradient: null},
         zPlaneRear: {fillOpacity: 0.2, gradient: null}
     }
 );

 // Two points
 var center = view.create('point3d', [0, 0, 0], {withLabel: false, size: 2});
 var point = view.create('point3d', [2, 0, 0], {withLabel: false, size: 2});

 // Sphere
 var sphere = view.create('sphere3d', [center, point], {fillOpacity: 0.8});

 // Glider on sphere
 var glide = view.create('point3d', [2, 2, 0, sphere], {withLabel: false, color: 'red', size: 4});
 var l1 = view.create('line3d', [glide, center], { strokeWidth: 2, dash: 2 });

Attributes

Own

none

Inherited

Members

Own

none

Inherited

Methods

Own

none

Inherited

Events

Own

none

Inherited

Throws

If the element cannot be constructed with the given parent objects an exception is thrown.

Type
Exception

Details

Type
JXG.Sphere3D
Source
3d/sphere3d.js, line 407

Extends