LaTeXFan
LaTeXFan

Reputation: 1231

Graph of the level set of a function

I want to plot the zero-set of function $f(x)=-x^2-y^2+z^2-1$. Can I do this in R, please? If so, how? More generally, how do I plot a function given a constraint, please? Thank you! If R does not work, what other software are good at such thing, please?

Upvotes: 2

Views: 871

Answers (1)

josliber
josliber

Reputation: 44330

You could use:

library(misc3d)
x = seq(-10, 10, 0.1)
y = seq(-10, 10, 0.1)
z = seq(-10, 10, 0.1)
f = function(x, y, z) -x^2-y^2+z^2-1
contour3d(f, 0 , x, y, z)

Upvotes: 4

Related Questions