% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ellipse.R
\name{Ellipse2D}
\alias{Ellipse2D}
\title{2D ellipse R6 Class}
\description{
\code{Ellipse2D} is an \code{\link[R6:R6Class]{R6::R6Class()}} object representing one or more
two-dimensional ellipses.  It inherits from \link{Coord2D} so its center(s)
can be used with \verb{$x} / \verb{$y} / \verb{$xyw} etc.  The semi-axes \code{rx}/\code{ry}
and orientation angle \code{theta} are updated automatically by each
transformation method.
}
\details{
When \code{rx == ry} (within floating-point tolerance) the ellipse is a
circle, which can be tested with the \verb{$is_circle} active binding.
}
\examples{
# An ellipse
e <- as_ellipse2d(as_coord2d(0, 0), rx = 2, ry = 1, theta = degrees(45))
print(e)
e$is_circle

# A circle (special case)
c1 <- as_ellipse2d(as_coord2d(0.5, 0.5), rx = 0.5)
print(c1)
c1$is_circle
}
\section{Super class}{
\code{\link[affiner:Coord2D]{Coord2D}} -> \code{Ellipse2D}
}
\section{Active bindings}{
  \if{html}{\out{<div class="r6-active-bindings">}}
  \describe{
    \item{\code{rx}}{Numeric vector of x-axis semi-radii (in the ellipse local frame).}

    \item{\code{ry}}{Numeric vector of y-axis semi-radii (in the ellipse local frame).}

    \item{\code{theta}}{An \code{\link[=angle]{angle()}} vector of rotation angles of the ellipse
x-axis relative to the global x-axis.}

    \item{\code{is_circle}}{Logical vector; \code{TRUE} for each ellipse where
\code{rx == ry} within floating-point tolerance.}
  }
  \if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
  \itemize{
    \item \href{#method-Ellipse2D-initialize}{\code{Ellipse2D$new()}}
    \item \href{#method-Ellipse2D-print}{\code{Ellipse2D$print()}}
    \item \href{#method-Ellipse2D-transform}{\code{Ellipse2D$transform()}}
    \item \href{#method-Ellipse2D-clone}{\code{Ellipse2D$clone()}}
  }
}
\if{html}{\out{<details><summary>Inherited methods</summary>
<ul>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="permute"><a href='../../affiner/html/Coord2D.html#method-Coord2D-permute'><code>Coord2D$permute()</code></a></span></li>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="project"><a href='../../affiner/html/Coord2D.html#method-Coord2D-project'><code>Coord2D$project()</code></a></span></li>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="reflect"><a href='../../affiner/html/Coord2D.html#method-Coord2D-reflect'><code>Coord2D$reflect()</code></a></span></li>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="rotate"><a href='../../affiner/html/Coord2D.html#method-Coord2D-rotate'><code>Coord2D$rotate()</code></a></span></li>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="scale"><a href='../../affiner/html/Coord2D.html#method-Coord2D-scale'><code>Coord2D$scale()</code></a></span></li>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="shear"><a href='../../affiner/html/Coord2D.html#method-Coord2D-shear'><code>Coord2D$shear()</code></a></span></li>
  <li><span class="pkg-link" data-pkg="affiner" data-topic="Coord2D" data-id="translate"><a href='../../affiner/html/Coord2D.html#method-Coord2D-translate'><code>Coord2D$translate()</code></a></span></li>
</ul>
</details>}}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-Ellipse2D-initialize"></a>}}
\if{latex}{\out{\hypertarget{method-Ellipse2D-initialize}{}}}
\subsection{\code{Ellipse2D$new()}}{
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{Ellipse2D$new(xyw, rx, ry, theta)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{xyw}}{A matrix with three columns for homogeneous center coordinates
(\code{"x"}, \code{"y"}, \code{"w"}).}
      \item{\code{rx}}{Numeric vector of x-axis semi-radii.}
      \item{\code{ry}}{Numeric vector of y-axis semi-radii.}
      \item{\code{theta}}{An \code{\link[=angle]{angle()}} vector (or numeric, interpreted using
the default angular unit) of rotation angles.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-Ellipse2D-print"></a>}}
\if{latex}{\out{\hypertarget{method-Ellipse2D-print}{}}}
\subsection{\code{Ellipse2D$print()}}{
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{Ellipse2D$print(n = NULL, ...)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{n}}{Number of ellipses to print.  If \code{NULL} print all.}
      \item{\code{...}}{Passed to \code{\link[=format.default]{format.default()}}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-Ellipse2D-transform"></a>}}
\if{latex}{\out{\hypertarget{method-Ellipse2D-transform}{}}}
\subsection{\code{Ellipse2D$transform()}}{
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{Ellipse2D$transform(mat = transform2d())}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{mat}}{A 3x3 matrix representing a post-multiplied affine transformation matrix.
The last \strong{column} must be equal to \code{c(0, 0, 1)}.
If the last \strong{row} is \code{c(0, 0, 1)} you may need to transpose it
to convert it from a pre-multiplied affine transformation matrix to a post-multiplied one.
If a 2x2 matrix (such as a 2x2 post-multiplied 2D rotation matrix)
we'll quietly add a final column/row equal to \code{c(0, 0, 1)}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-Ellipse2D-clone"></a>}}
\if{latex}{\out{\hypertarget{method-Ellipse2D-clone}{}}}
\subsection{\code{Ellipse2D$clone()}}{
  The objects of this class are cloneable with this method.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{Ellipse2D$clone(deep = FALSE)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{deep}}{Whether to make a deep clone.}
    }
    \if{html}{\out{</div>}}
  }
}

}
