{"id":15292994,"url":"https://github.com/friendly/gellipsoid","last_synced_at":"2026-02-06T10:02:19.217Z","repository":{"id":62459181,"uuid":"464182287","full_name":"friendly/gellipsoid","owner":"friendly","description":"Generalized ellipsoids","archived":false,"fork":false,"pushed_at":"2024-11-10T22:22:33.000Z","size":2022,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T13:46:31.088Z","etag":null,"topics":["3d-graphics","ellipse","geometry","matrix","r"],"latest_commit_sha":null,"homepage":"https://friendly.github.io/gellipsoid/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/friendly.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-27T15:56:13.000Z","updated_at":"2024-11-10T22:24:03.000Z","dependencies_parsed_at":"2024-11-10T23:20:29.568Z","dependency_job_id":"1764196d-3538-4be5-abad-789614e7e1ff","html_url":"https://github.com/friendly/gellipsoid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/friendly/gellipsoid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendly%2Fgellipsoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendly%2Fgellipsoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendly%2Fgellipsoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendly%2Fgellipsoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friendly","download_url":"https://codeload.github.com/friendly/gellipsoid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendly%2Fgellipsoid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29157471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-graphics","ellipse","geometry","matrix","r"],"created_at":"2024-09-30T16:37:09.540Z","updated_at":"2026-02-06T10:02:19.150Z","avatar_url":"https://github.com/friendly.png","language":"R","readme":"---\noutput:   \n  github_document:\nalways_allow_html: yes\n---\n\n\u003c!--\n    math_method:\n      engine: webtex\n      url: http://chart.apis.google.com/chart?cht=tx\u0026chl=\n--\u003e\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  message = FALSE,\n  fig.path = \"man/figures/README-\",\n  out.width = \"60%\"\n)\n```\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![License](https://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-2.0.html) \n[![CRAN](https://www.r-pkg.org/badges/version/gellipsoid)](https://cran.r-project.org/package=gellipsoid)\n[![Downloads](https://cranlogs.r-pkg.org/badges/gellipsoid)](https://cran.r-project.org/package=gellipsoid)\n\n\u003c!-- badges: end --\u003e\n\n# gellipsoid: Generalized Ellipsoids \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"150px\" /\u003e\n\nThe gellipsoid package extends the class of geometric ellipsoids to \"generalized ellipsoids\", which allow degenerate ellipsoids that are flat and/or unbounded. Thus, ellipsoids can be naturally defined to include lines, hyperplanes, points, cylinders, etc.\nThe methods can be used to represent generalized ellipsoids in a $d$-dimensional space\n$\\mathbf{R}^d$, with plots in up to 3D.\n\n\u003c!-- The motivation for this more general representation is to allow a notation for a class of generalized ellipsoids --\u003e\n\u003c!-- that is algebraically closed under --\u003e\n\nThe goal is to be able to think about, visualize, and compute a linear transformation of an ellipsoid with central matrix\n$\\mathbf{C}$ or its inverse $\\mathbf{C}^{-1}$ which apply equally to unbounded and/or degenerate ellipsoids.\nThis permits exploration of a variety to statistical issues that can be visualized using ellipsoids\nas discussed by Friendly, Fox \u0026 Monette (2013), _Elliptical Insights: Understanding Statistical Methods \nThrough Elliptical Geometry_ \u003cdoi:10.1214/12-STS402\u003e.\n\nThe implementation uses a $(\\mathbf{U}, \\mathbf{D})$ representation,\nbased on the singular value decomposition (SVD)\nof an ellipsoid-generating matrix, $\\mathbf{A} = \\mathbf{U} \\mathbf{D} \\mathbf{V}^{T}$,\nwhere $\\mathbf{U}$ is square orthogonal and $\\mathbf{D}$ is diagonal.\n\nFor the usual, \"proper\" ellipsoids, $\\mathbf{A}$ is positive-definite so all elements of $\\mathbf{D}$ are positive.\nIn generalized ellipsoids, $\\mathbf{D}$ is extended to non-negative real numbers, i.e. \nits elements can be 0, Inf or a positive real.\n\n#### Definitions\n\nA _proper_ ellipsoid in $\\mathbf{R}^d$ can be defined by $\\mathbf{E} := \\{x \\; : \\; x^T \\mathbf{C} x \\le 1 \\}$\nwhere $\\mathbf{C}$ is a non-negative definite central matrix, \nIn applications, $\\mathbf{C}$ is typically a variance-covariance matrix\nA proper ellipsoid is _bounded_, with a non-empty interior.\nWe call these **fat** ellipsoids.\n\nA degenerate _flat_ ellipsoid corresponds to one where the central matrix $\\mathbf{C}$ is singular\nor when there are one or more zero singular values in $\\mathbf{D}$.\nIn 3D, a generalized ellipsoid that is flat in one dimension \n($\\mathbf{D} = \\mathrm{diag} \\{X, X, 0\\}$) collapses to an ellipse;\none that is flat in two dimensions ($\\mathbf{D} = \\mathrm{diag} \\{X, 0, 0\\}$)\ncollapses to a line, and one that is flat in three dimensions collapses to a point.\n\nAn _unbounded_ ellipsoid is one that has infinite extent in one or more directions,\nand is characterized by infinite singular values in $\\mathbf{D}$.\nFor example, in 3D, an unbounded ellipsoid with one infinite singular value is\nan infinite cylinder of elliptical cross-section.\n\n## Principal functions\n\n* `gell()` Constructs a generalized ellipsoid using the $(\\mathbf{U}, \\mathbf{D})$ representation. The\ninputs can be specified in a variety of ways:\n  + a non-negative definite variance matrix;\n  + an inner-product matrix\n  + a subspace with a given span\n  + a matrix giving a linear transformation of the unit sphere\n  \n* `dual()` calculates the dual or inverse of a generalized ellipsoid\n* `gmult()` calculates a linear transformation of a generalized ellipsoid\n* `signature()` calculates the signature of a generalized ellipsoid, a vector of length 3 giving the number of positive, zero and infinite singular values in the (U, D) representation.\n\n\n* `ell3d()` Plots generalized ellipsoids in 3D using the `rgl` package\n\n## Installation 📦\n\nYou can install the `gellipsoid` package from CRAN as follows:\n\n``` r\ninstall.packages(\"gellipsoid\")\n```\n\nOr, You can install the development version of gellipsoid from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"friendly/gellipsoid\")\n```\n\n## Example 🛠\n\n#### Properties of generalized ellipsoids\nThe following examples illustrate `gell` objects and their properties. Each of these may be plotted in 3D\nusing `ell3d()`.  These objects can be specified in a variety of ways, but for these examples the span\nis simplest.\n\nA unit sphere in $R^3$ has a central matrix of the identity matrix.\n```{r ex1}\nlibrary(gellipsoid)\n(zsph \u003c- gell(Sigma = diag(3)))  # a unit sphere in R^3\nsignature(zsph)\nisBounded(zsph)\nisFlat(zsph)\n```\n\nA plane in $R^3$ is flat in one dimension.\n\n```{r ex2}\n(zplane \u003c- gell(span = diag(3)[, 1:2]))  # a plane\nsignature(zplane)\nisBounded(zplane)\nisFlat(zplane)\n\ndual(zplane)  # line orthogonal to that plane\nsignature(dual(zplane))\n\n```\n\nA hyperplane. Note that the `gell` object with a center contains more information than\nthe geometric plane.\n\n```{r ex3}\n(zhplane \u003c- gell(center = c(0, 0, 2), \n                 span = diag(3)[, 1:2]))  # a hyperplane\nsignature(zhplane)\n\ndual(zhplane)  # orthogonal line through same center\n\n```\n\nA point:\n\n```{r}\nzorigin \u003c- gell(span = cbind(c(0, 0, 0)))\nsignature(zorigin)\n\n# what is the dual (inverse) of a point?\ndual(zorigin)\n\nsignature(dual(zorigin))\n\n```\n\n\n\n\u003c!-- You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this. You could also use GitHub Actions to re-render `README.Rmd` every time you push. An example workflow can be found here: \u003chttps://github.com/r-lib/actions/tree/v1/examples\u003e. --\u003e\n\n#### Drawing generalized ellipsoids\n\nThe following figure shows views of two generalized ellipsoids.\n$C_1$ (blue) determines a proper, fat ellipsoid; it's inverse $C_1^{-1}$ also generates a proper ellipsoid.\n$C_2$ (red) determines an improper, flat ellipsoid, whose inverse $C_2^{-1}$ is an unbounded cylinder of elliptical\ncross-section.\n$C_2$ is the projection of $C_1$ onto the plane where $z = 0$.\nThe scale of these ellipsoids is defined by the gray unit sphere.\n\n```{r, echo=FALSE}\nknitr::include_graphics(\"man/figures/gell3d-1.png\")\n```\n\n\nThis figure illustrates the orthogonality of each $C$ and its dual, $C^{-1}$. \n```{r, echo=FALSE}\nknitr::include_graphics(\"man/figures/gell3d-4.png\")\n```\n\n## References\n\nFriendly, M., Monette, G. and Fox, J. (2013). Elliptical\nInsights: Understanding Statistical Methods through Elliptical Geometry.\n_Statistical Science_, **28**(1), 1–39.\n[Online paper](https://www.datavis.ca/papers/ellipses-STS402.pdf);\n[DOI](https://doi.org/10.1214/12-STS402)\n\nFriendly, M. (2013). Supplementary materials for \"Elliptical Insights ...\",\nhttps://www.datavis.ca/papers/ellipses/ \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendly%2Fgellipsoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendly%2Fgellipsoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendly%2Fgellipsoid/lists"}