Global

Members

algorithm :Enum.<String>

Variable that stores the current algorithm tha is being executed
Type:
  • Enum.<String>
Source:

(constant) algorithms :String

Enumeration of the different algorithm types
Type:
  • String
Source:

(constant) direction :String

Enumeration of the possible directions the algorithm can use when generating the convex hull
Type:
  • String
Source:

(constant) divideSteps :Integer

Enumeration of the possible state the divide and conquer algorithm can be in
Type:
  • Integer
Source:

(constant) grahamSteps :Integer

Enumeration of the possible state the graham scan algorithm can be in
Type:
  • Integer
Source:

(constant) jarvisSteps :Integer

Enumeration of the possible state the jarvis march algorithm can be in
Type:
  • Integer
Source:

(constant) monotoneSteps :Integer

Enumeration of the possible state the monotone chain algorithm can be in
Type:
  • Integer
Source:

numPoints :Integer

Number of points to be bound by the generated convex hull
Type:
  • Integer
Source:

pointRadius :Integer

Size of the points drawn on the canvas
Type:
  • Integer
Source:

pointsDisplay :p5.Element

Pointer for the paragraph which shows the number of points in the DOM
Type:
  • p5.Element
Source:

pointsSlider :p5.Element

Pointer for the number of points slider in the DOM
Type:
  • p5.Element
Source:

selectAlgorithm :p5.Element

Pointer to select field that selects the executing algorithm
Type:
  • p5.Element
Source:

selectAngularDirection :p5.Element

Pointer to select field that selects the direction that the Jarvis march algorithm finds theconvex hull
Type:
  • p5.Element
Source:

selectSplitMethod :p5.Element

Pointer to select field that selects the method that is used to split the points when divide and conquer is running
Type:
  • p5.Element
Source:

(constant) splitMethods :String

Enumeration of the different methods for splitting the points
Type:
  • String
Source:

xBuffer :Integer

Variable that store how far away from the side edges new points can spawn
Type:
  • Integer
Source:

yBuffer :Integer

Variable that store how far away from the top and bottom edges new points can spawn
Type:
  • Integer
Source:

Methods

algorithmSelectEvent()

Changes the algorithm depending on what the value of the selectAlgorithm element is
Source:

angularSelectEvent()

Changes the direction the jarvis march algorithm selects new points for the convex hull depending on the value of the selectAngularDirection element
Source:

calculateHull(hullIndex)

Calculates the internal hull for one of the subsections after division
Parameters:
Name Type Description
hullIndex Integer Select which hull to calculate from 0 to 2
Source:

chunkArray(array, chunkSize)

Returns an array with arrays of the given size.
Parameters:
Name Type Description
array Array Array to split
chunkSize Integer Size of every group
Source:

crossZ(a, b, o) → {Float}

Finds the z component of the cross product of three vectors
Parameters:
Name Type Description
a p5.Vector
b p5.Vector
o p5.Vector
Source:
Returns:
Type
Float

divideAndConquer()

The Divide & Conquer algorithm
Source:

draw()

p5.js draw function, is run every frame to create the desired animation
Source:

drawEdges(hullArray, colour)

Draws the edges of a convex hull with a given colour
Parameters:
Name Type Description
hullArray Array.<p5.Vector> Array of points that amke up the verticies of the hull.
colour Integer Value of the hue of the given hull from 0 to 100
Source:

drawHull(hullArray, colour)

Draws a convex hull with a given colour
Parameters:
Name Type Description
hullArray Array.<p5.Vector> Array of points that amke up the verticies of the hull.
colour Integer Value of the hue of the given hull from 0 to 100
Source:

fuse()

Combines the three internal hulls into the final convex hull for all points
Source:

grahamScan()

The graham scan algorithm
Source:

jarvisMarch()

Jarvis March algorithm function
Source:

monotoneChain()

The monotone chain algorithm
Source:

reset()

Reset all algorithm variables to initial values
Source:

setup()

p5.js setup function, creates canvas.
Source:

splitSelectEvent()

Changes the method for splitting the points in divide and conquer depending on the value of the selectSplitMethod element
Source:

Documentation generated by JSDoc 3.6.3 on Sun Jun 05 2022 20:10:36 GMT+0100 (BST)