Home :: GUI :: Shapes

  1. Introduction
  2. Reference
    1. Methods
      1. constructor
      2. init
      3. realize
      4. translate
      5. refresh
      6. registerHandles
      7. unregisterHandles
      8. selectHandles
      9. showHandles
      10. getIntersectionParams
    2. Properties
      1. center
      2. last
      3. radius
  3. Example
  4. Download

Introduction

Circle is a JavaScript object that allows you to interactively manipulate a circle via Handle objects: a center handle and a radius handle. This code is used in the 2D Geometry section of this site.

The circle object includes methods for finding the intersection of a circle with a circle and the intersection of a circle with a line.

Circle is a sub-class of the Shape class and therefore inherits all methods and properties of the Shape class.


Reference

Methods

constructor - new Circle(svgNode);

This method creates a new Circle object. All initialization is handled by the init() method. All parameters for this method are described below.

init(svgNode);

realize();

translate(delta);

refresh();

registerHandles();

unregisterHandles();

selectHandles();

showHandles();

getIntersectionParams() : IntersectionParams;

Properties


Example

This example allows you to adjust the position and radius of the circles within the SVG document. Here is a brief summary of the editing procedures:


Download

Circle.js - the circle object only...cannot be used in isolation

2D.js.gz - all objects needed to use this object and other 2D geometry objects