Question: A superellipse is defined by the inequality | ( x ) / ( a ) | ^ ( n ) + | ( y )
A superellipse is defined by the inequality
xanybn
where x and y are the Cartesian coordinates, and a and b are the length of long and short axes
with n the deformation parameter. An example of a superellipse centered at r with a
b and n is shown in the figure below, where ex and ey are the unit vectors
pointing to the direction of long and short axes, respectively, and exey All vectors here
are column vectors.
Questions:
Write a program "CalVolume abn to numerically calculate the area S of a
superellipse for given a and b For ab plot S as a function of nin
and compare your result with the analytical formula
Snabs qrtpi Gamma nGamma n
where Gamma is the Gamma function.
marks
Write a Matlab program "DrawSuperellipse rabnexeyto draw a superellipse
entered at r for a given abnex and ey The input of the program is
rabnexey
marks
Write a program "Distance rabnexeyrabnexey using the
Newton's method to calculate the shortest distance between two points on two
superellipses rabnexey and rabnnexey where ab
ab for The program should return a value of if two
superellipses are overlapped. Use your program to calculate the shortest distance
between two superellipses with the location and orientation listed in Table and draw
the two closest points on the two superellipses.
Table
Please assist in coming up with the matlab script for Question only using Newton Method only D OR D thank you so much in advance. The correct shortest distances are approximately units when n units when n units when n Maybe come up with matlab scripts of first derivative second derivative distance newton starting point, transform closestpoint,etc?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
