How to draw ellipsoid with plotly

前端 未结 3 445
走了就别回头了
走了就别回头了 2021-01-14 06:36

Are there any way to plot a surface like ellipsoid with plotly 3D?

Currently only surfaces of the form z=f(x,y) are discussed in the docs. There is also Mes

3条回答
  •  不思量自难忘°
    2021-01-14 07:08

    Why not solve for z in this equation grabbed from the Mathematic item on ellipsoids:

    require(plotly)
    a=5; b=7; c=9
    x=rep(seq(-10,10,by=1), each=21)
    y=rep( seq(-10,10,by=1), times=21)
    z <- c^2*sqrt(1-x^2/a^2-y^2/b^2)
    #Warning message:
    #In sqrt(1 - x^2/a^2 - y^2/b^2) : NaNs produced
    
     plot_ly(z = matrix(z,21,21), type = "surface")
    

提交回复
热议问题