dylannalex / curvipy Goto Github PK
View Code? Open in Web Editor NEWMake math animations in a few lines of code.
Home Page: https://curvipy.readthedocs.io/en/latest/
License: MIT License
Make math animations in a few lines of code.
Home Page: https://curvipy.readthedocs.io/en/latest/
License: MIT License
The docstrings need some updates. A few minor typos and grammatical errors need to be corrected.
Create a tests directory for testing Curvipy classes.
The idea is to exclude a list of values from the interval, so they won't be considered when plotting the curve.
curvipy.Interval:
Parameters
----------
start : int or float
Real number in which the interval starts.
end : int or float
Real number in which the interval ends.
samples: int
Number of values within the interval. The more samples, the more precise the \
curve plot is.
exclude: list[int or float]
List of values that will be excluded from the interval.
Example: imagine we want to plot the curve
import curvipy
def f(x):
return 1 / x
plotter = curvipy.Plotter()
a = 10
curve = curvipy.Function(f)
interval_one = curvipy.Interval(-a, -0.1, 100)
interval_two = curvipy.Interval(0.1, a, 100)
plotter.plot_curve(curve, interval_one)
plotter.plot_curve(curve, interval_two)
plotter.wait()
With an 'exclude' parameter on 'curvipy.Interval' class, we could accomplish the same goal with only one interval:
import curvipy
def f(x):
return 1 / x
plotter = curvipy.Plotter()
a = 10
curve = curvipy.Function(f)
interval = curvipy.Interval(-a, a, 200, exclude=[0])
plotter.plot_curve(curve, interval)
plotter.wait()
If somebody wants to work on it, please make a comment. Implementing this is not as easy as it seems and might need modifications in other classes like curvipy.Plotter and/or curvipy.Curve.
This implies adding two new attributes to 'curvipy.AxesConfiguration' class:
A few aspects to keep in mind:
GIFs shown on documentation (both README and docs) are from curvipy v1.0.1. To update the animations, just run the code shown above the GIF and record the screen with some third party software (e.g. ActivePresenter).
Given the vectors
import curvipy
v = curvipy.Vector([10, 10])
w = curvipy.Vector([5, -5])
n = v + w
m = v - w
This is not possible on Curvipy 1.0.1. To do so, users have to calculate
import curvipy
v = curvipy.Vector([10, 10])
w = curvipy.Vector([5, -5])
n = curvipy.Vector([10 + 5, 10 + (-5)])
m = curvipy.Vector([10 - 5, 10 - (-5)])
The Curve
class and its subclasses use the method points
to return the curve points.
Currently, the return type of the points
method is list[int | float]
.
But the return type should be list[tuple[int | float, int | float]]
Create README.es.md
file, a translated version of README.md
.
We should add __eq__
, __str__
and __repr__
methods to the module
A function that rotates the curve by a certain TransformedCurve
, but the matrix used will be:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.