## Points defining a 4-norm unit-circle in the first quadrant
x <- seq(0,1,.01)^(1/4)
y <- (1-x^4)^(1/4)
## Polar coordinates using different distance-measures
eucl <- cart2pol(x,y)
mink <- cart2pol(x,y,'minkowski',4)
## Plot in cartesian coordinates
dev.new()
plot(x,y,type='b',main='4-norm unit circle')
## Plot polar coordinates on cartesian axes
dev.new()
plot(eucl$th,eucl$r,type='b',col='red',xlab='theta',ylab='r')
points(mink$th,mink$r,type='b',col='blue')
title(main='Euclidean (red) and 4-norm (blue) distance')
Run the code above in your browser using DataLab