Name
SPVM::Point3D - Point 3D
Usage
use Point3D;
my $point = Point3D->new;
my $point = Point3D->new(1, 2, 3);
my $x = $point->x;
my $y = $point->y;
my $z = $point->z;
my $point_string = $point->to_string;
Description
Point3D
is a class for a point 3D.
Super Class
Point is the super class of Point3D
.
Fields
Point3D
inherits the fields of Point.
z
has z : ro int;
z
.
Class Methods
new
static method new : Point3D ($x : int = 0, $y : int = 0, $z : int = 0);
Creates a new Point3D
object with $x, $y, $z.
Instance Methods
Point3D
inherits the instance methods of Point.
init
protected method init : Point3D ($x : int = 0, $y : int = 0, $z : int = 0)
Initializes "x", "y", and "z".
clear
method clear : void ();
clone
method clone : Point3D ();
Creates a new Point3D
object that clones myself.
to_string
method to_string : string ();
Stringifies Point3D
object as the following format.
(1,2,3)
eq
method eq : int ($a : Point, $b : Point);
If $a is equal to $b, returns 1, otherwise returns 0.
Implementation:
If $a and $b is defined and "x" and "y" fields in $a are equals to "x" and "y" fields in $b, returns 1.
If only $a is not defined, returns 0.
If only $b is not defined, returns 0.
If both $a and $b is not defined, returns 1.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License