I use the ellipsoidhull method from cluster package to obtain the minimum volume enclosing ellipsoid (mvee) from a set of points. This method returns an object of class ellipsoid. I need to plot the generated ellipsoid. I tried to use the wire3d method from rgl package to plot ellipsoids but this method gets objects of class mesh3d as input parameter. How can I convert an ellipsoid object to a mesh3d object?
How to convert ellipsoid to mesh3d in R?
378 Views Asked by m.taheri At
2
There are 2 best solutions below
0
Stéphane Laurent
On
library(cluster)
xyz <- cbind(rnorm(10), rnorm(10), rnorm(10))
e <- ellipsoidhull(xyz)
A <- e$cov
center <- e$loc
r <- sqrt(e$d2)
library(Rvcg)
sphr <- vcgSphere()
library(rgl)
ell <- translate3d(
scale3d(
transform3d(sphr, chol(A)),
r, r, r),
center[1], center[2], center[3])
shade3d(ell, color="red", alpha=0.3)
points3d(xyz)
Related Questions in R
- How to make an R Shiny app with big data?
- How do I keep only specific rows based on whether a column has a specific value?
- Likert scale study - ordinal regression model
- Extract a table/matrix from R into Excel with same colors and stle
- How can I solve non-conformable arguments in R netmeta::discomb (Error in B.matrix %*% C.matrix)?
- Can raw means and estimated marginal means be the same ? And when?
- Understanding accumulate function when .dir is set to "backwards"
- Error in if (nrow(peaks) > 0) { : argument is of length zero Calls: CopywriteR ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution ha
- How to increase quality of mathjax output?
- Convert the time intervals to equal hours and fill in the value column
- How to run an R function getpoints() from IPDfromKM package in an R shiny app which in R pops up a plot that utilizes clicks to capture coordinates?
- Replace NA in list of dfs in certain columns and under certain conditions
- R and text on Cyrillic
- The ts() function in R is returning the correct start and frequency but not end value which is 1 and not 179
- TROUBLING with the "DROP_NA" Function
Related Questions in ELLIPSE
- Detecting Circles and Ellipses from Point Arrays in Java
- What causes the ellipse's circumscribed rectangle to draw incorrectly?
- I have error of unexpected symbol in ellipse fuction. I tried to draw ellipse using ellipse pakage
- Rotating an ellipse alongside its major axes
- Using additional arguments in a R function inside purrr::map_df have no effect
- Why is a 'border-bottom' looking like an ellipse on mobile?
- Android BottomNavigation avoid label getting truncated when selected
- Ellipses do not align with data using SIBER R package
- How to calculate an ellipse area in pixel?
- Python Turtle Vertical Oval
- turtle python how to draw an ellipse from the start of coordinates
- Is there a method to ensure that an SVG ellipse, which has a stroke width of 40px, is of the same size as another ellipse that does not have a stroke?
- Fitting an ellipse in python
- Fitting ellipse with 95% CI to points and calculating area within specific line segments
- P5JS Data Visualization Mapping
Related Questions in RGL
- Control space between data lines in a 3D plot
- Displaying an updating network graph without reloading wireframe
- Callback behavior for objects with the same scene ID
- setUserCallbacks() to scene generated with newSubscene3d()
- How to use point shapes other than spheres in rgl?
- I can't get rgl to save snapshots or gifs
- Is the return value of cur3d() correct in this example?
- how to fix incorrect image saving as vector graphics in "rgl" package?
- rgl.setMouseCallbacks: Callbacks Cannot Restore Default Behavior
- Animate trajectory in a Shiny app without explicit controls
- How to change default position of RGL window in R?
- How to check/decide/segment whether a point is inside a 3d cone?
- How to change perspective in Rayshader RGL without a middle mouse button?
- planes3d expands and draws the area based on the sphere's radius
- Print an rgl plot from each iteration in a for loop to HTML in RMarkdown?
Related Questions in DRAWELLIPSE
- I have error of unexpected symbol in ellipse fuction. I tried to draw ellipse using ellipse pakage
- ImageJ: How to adjust color of plotted ellipses based on pre-defined RGB values?
- Plotting the elliptical distribution of eigenvalues for correlated random matrices
- Calculate SVG path arc parameters
- How to detect ellipse and remove outliers in image using opencv Python
- How to draw an ellipsoid using tilted or rotated lines using Plotly?
- How do draw.ellipsoid and ellipse_stats from sckimage.draw.ellipse work with grid spacing?
- Circle drawing problems (JFreeChart )
- PDFsharp DrawRoundedRectangle parameters
- How to draw circles faster on windows form?
- draw a ellipse curve in fragment shader
- DrawEllipse: Antialiasing broken with PenAlignment.Inset
- DrawEllipse: Ellipse goes outside of the Bitmap size
- Why is the circle I drew larger than expected?
- Processing: Ellipse mouse follow without overlap
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

If you don't actually care about a mesh, and are just looking to plot a transparent ellipsoid you can use this:
Yielding:
I modified the interesting answer from cuttlefish44 to get this - see this link: enter link description here
There is also a
qmesh3danswer from dww there that you could modify in a similar manner to get a mesh3d if that is what you really want, but I thought this more elegant.