An open API service indexing awesome lists of open source software.

https://github.com/yevhenbk/arc-length-calculator

This app calculates the arc length of a given function over the interval [0, 4] using numerical integration
https://github.com/yevhenbk/arc-length-calculator

numpy python scipy

Last synced: about 1 month ago
JSON representation

This app calculates the arc length of a given function over the interval [0, 4] using numerical integration

Awesome Lists containing this project

README

        

# Arc Length Calculator and Plotter

This Python app calculates the arc length (longitud del recorrido) of a given function f(x) = x^3 - 5x^2 + 6x over the interval [0,4], using numerical integration.
The app also optionally plots the function to visualize the profile of the curve.

## Features

**Numerical Integration:** Calculates the arc length of the function using SciPy's `quad()` function.
**Plotting:** Optionally generates a plot of the function 𝑓(𝑥) to visualize its shape.

## Install the required packages

```

pip install numpy scipy matplotlib

```

## How to Use

To calculate the arc length and (optionally) plot the function, simply run the Python script:

```

python arc_length_with_plot.py

```

## Example

The result will be displayed as follows:

```

Longitud del recorrido: 15.1234 metros

```

## Additionally, the function's graph will be displayed to visualize the profile

![Plot Image](https://github.com/Yevhenbk/arc-length-calculator/blob/main/arc_length_plot.png)