Learn R Programming

gdi (version 1.10.0)

sellipse.coo: calculate coordinates for plotting a superellipse for visualizing body cross-sections

Description

calculate coordinates for plotting a superellipse for visualizing body cross-sections

Usage

sellipse.coo(k, res = 100)

Value

a data frame containing x and y coordinates for the outline of the (super)ellipse

Arguments

k

superellipse exponent.

res

the desired resolution

Examples

Run this code
sellipse.coo(2.0)->df #get coordinates for normal ellipse (exponent k=2)
plot(df$x,df$y,col="black", type="l") #plot normal ellipse
sellipse.coo(2.3)->df2 # get coordinates for superellipse with exponent 2.3
lines(df$x,df$y, col="blue") #plot superellipse

Run the code above in your browser using DataLab