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 email@example.com. 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
- 7 Common Programming Principles That Every Developer Must Follow
- Count of N-bit binary numbers without leading zeros
- Find the next fibonacci number
- Maximum number of line intersections formed through intersection of N planes
- Sum of all the numbers present at given level in Pascal's triangle
- Product of values of all possible non-empty subsets of given Array
- Program to find Nth odd Fibonacci Number
- SOLID Principle in Programming: Understand With Real Life Examples
- Best Books to Learn Back-End Web Development
- Sum of numbers in a range [L, R] whose count of divisors is prime
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.