Parse

File Parse area.js

This tree is parsed live from the source file.

Classes

  • {{ item.name }}

    • {{ key }}

Not Classes

{{ getTree() }}

Comments

{{ getTreeComments() }}

Source

            

const pointArea = function(p) {
    return circleArea(p.radius)
}

const pointCircumference = function(p) {
    return radiusCircumference(p.radius)
}

const radiusCircumference = function(radius) {
    return 2 * Math.PI * radius
}


const circleArea = (radius, pi=Math.PI) => {
   return pi * radius * radius;
};



Polypoint.installFunctions('Point', {
    getArea() {
        return circleArea(this.radius)
    }

    , getCircumference() {
        return radiusCircumference(this.radius)
    }

});

copy