ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Ellipse.h
Go to the documentation of this file.
1/**
2 * @file Ellipse.h
3 * @brief Defines the Ellipse class for representing elliptical shapes in 2D space.
4 *
5 * The Ellipse class provides functionality to define an ellipse by its center, size, and rotation,
6 * and check if a given point lies within the ellipse's boundaries.
7 *
8 * @date 22/12/2024
9 * @version 1.0
10 * @author Coela Can't
11 */
12
13#pragma once
14
15#include "Shape.h"
16
17/**
18 * @class Ellipse
19 * @brief Represents an ellipse in 2D space.
20 */
21class Ellipse : public Shape {
22public:
23 /**
24 * @brief Constructs an Ellipse object with specified center, size, and rotation.
25 * @param center Center point of the ellipse.
26 * @param size Dimensions of the ellipse (width and height).
27 * @param rotation Rotation angle of the ellipse in degrees.
28 */
30
31 /**
32 * @brief Checks if a given point lies within the ellipse's boundaries.
33 * @param point The point to check.
34 * @return True if the point is within the ellipse, otherwise false.
35 */
36 bool IsInShape(Vector2D point) override;
37};
Defines the Shape base class for representing geometric shapes in 2D space.
Represents an ellipse in 2D space.
Definition Ellipse.h:21
bool IsInShape(Vector2D point) override
Checks if a given point lies within the ellipse's boundaries.
Definition Ellipse.cpp:5
Abstract base class for 2D geometric shapes.
Definition Shape.h:22
float rotation
The rotation of the shape in degrees.
Definition Shape.h:26
Vector2D center
The center point of the shape.
Definition Shape.h:24
Vector2D size
The size of the shape, large enough to fit within a bounding rectangle.
Definition Shape.h:25
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Definition Vector2D.h:27