Files
JavaScript/Maths/test/CircularArc.test.js
Prashal Ruchiranga 109e4a685b algorithm: find length of an arc and area of the sector formed by an arc of a circle (#1119)
* Add an algorithm to find length and area of an arc of a circle

* Updated to follow Javascript Standard Style

* Update CircularArc.js

* Update CircularArc.js

* Add tests

* Followed Javascript standard style
2022-10-08 12:26:06 +05:30

20 lines
685 B
JavaScript

import { circularArcLength, circularArcArea } from '../CircularArc'
describe('circularArcLength', () => {
it('with natural number', () => {
const arcLengthOfOneThirty = circularArcLength(1, 30)
const arcLengthOfThreeSixty = circularArcLength(3, 60)
expect(arcLengthOfOneThirty).toBe(0.5235987755982988)
expect(arcLengthOfThreeSixty).toBe(3.141592653589793)
})
})
describe('circularArcArea', () => {
it('with natural number', () => {
const arcAreaOfOneThirty = circularArcArea(1, 30)
const arcAreaOfThreeSixty = circularArcArea(3, 60)
expect(arcAreaOfOneThirty).toBe(0.2617993877991494)
expect(arcAreaOfThreeSixty).toBe(4.71238898038469)
})
})