arc-length

1.0.2 • Public • Published

arc-length Build Status npm version js-standard-style

Compute the arc length of an n-dimensional curve using Romberg integration

Introduction

This module computes the arc length of a parameterized n-dimensional curve using adaptive Romberg integration.

Example

To compute the circumference of a circle:

var arcLength = require('arc-length')
 
arcLength([Math.cos, Math.sin], 0, Math.PI * 2)
//=> 6.283185307178426

Installation

$ npm install arc-length

API

require('arc-length')(y, start, end[, tol=1e-8 [, mindepth=2, maxdepth=10]]])

Arguments:

  • y: An Array of functions of a single parameter which define the curve.
  • start: The lower bound of integration.
  • end: The upper bound of integration.
  • tol (optional, default: 1e-8): The relative error tolerance
  • mindepth (optional, default: 2): The minimum recursion depth for adaptive integration
  • maxdepth (optional, default: 10): The maximum recursion depth for adaptive integration

Returns: Returns the scalar arc length

License

© 2016 Ricky Reusser. MIT License.

Readme

Keywords

Package Sidebar

Install

npm i arc-length

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • rreusser