What is a superellipse
A superellipse, also known as a Lamé curve after Gabriel Lamé, is a closed curve resembling the ellipse, retaining the geometric features of semi-major axis and semi-minor axis, and symmetry about them, but a different overall shape.
In the Cartesian coordinate system, the set of all points (x, y) on the curve satisfy the equation
where n, a and b are positive numbers, and the vertical bars | | around a number indicate the absolute value of the number.
There are many number of specific cases of superellipse like given in the image down below:
These can be achieved by varying the value of n in the equation. So now we try to implement this in python and to do that we are require some libraries.
- matplotlib: To plot the curve of the equation. Its an 3rd party library in python and if you want to install it click here.
- math : Its an built in library of python which have almost all the mathematical tools.
Now let’s see what happens when we changes the value of n to 0.5
Source Code of the program in Java.
This article is contributed by Subhajit Saha. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Implementing Photomosaics
- Implementing Web Scraping in Python with BeautifulSoup
- Python | Implementing 3D Vectors using dunder methods
- Implementing Artificial Neural Network training process in Python
- Maximum possible elements which are divisible by 2
- Minimum operations required to convert X to Y by multiplying X with the given co-primes
- Count ways to divide circle using N non-intersecting chord | Set-2
- Check if a number is Fermat Pseudoprime
- Largest and smallest digit of a number
- Overturning Changes In Git
- Examining Git
- Git- Debugging
- CAT Preparation 2019: A Complete Preparation Package You Require for Cracking CAT 2019
- Count pairs in an array such that the absolute difference between them is ≥ K
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.