hopefully replaced spaces with tabs everywhere

This commit is contained in:
GameHerobrine 2024-08-17 16:21:02 +03:00
parent ed4f820ff3
commit 89eb7097a3
42 changed files with 324 additions and 324 deletions

View file

@ -140,13 +140,13 @@ class Matrix implements ArrayAccess{
if($this->isSquare() !== true){
return false;
}
return match ($this->rows) {
1 => 0,
2 => $this->matrix[0][0] * $this->matrix[1][1] - $this->matrix[0][1] * $this->matrix[1][0],
3 => $this->matrix[0][0] * $this->matrix[1][1] * $this->matrix[2][2] + $this->matrix[0][1] * $this->matrix[1][2] * $this->matrix[2][0] + $this->matrix[0][2] * $this->matrix[1][0] * $this->matrix[2][1] - $this->matrix[2][0] * $this->matrix[1][1] * $this->matrix[0][2] - $this->matrix[2][1] * $this->matrix[1][2] * $this->matrix[0][0] - $this->matrix[2][2] * $this->matrix[1][0] * $this->matrix[0][1],
default => false,
};
}
return match ($this->rows) {
1 => 0,
2 => $this->matrix[0][0] * $this->matrix[1][1] - $this->matrix[0][1] * $this->matrix[1][0],
3 => $this->matrix[0][0] * $this->matrix[1][1] * $this->matrix[2][2] + $this->matrix[0][1] * $this->matrix[1][2] * $this->matrix[2][0] + $this->matrix[0][2] * $this->matrix[1][0] * $this->matrix[2][1] - $this->matrix[2][0] * $this->matrix[1][1] * $this->matrix[0][2] - $this->matrix[2][1] * $this->matrix[1][2] * $this->matrix[0][0] - $this->matrix[2][2] * $this->matrix[1][0] * $this->matrix[0][1],
default => false,
};
}
//Computation of the determinant of 2x2 and 3x3 matrices
@ -163,4 +163,4 @@ class Matrix implements ArrayAccess{
return "Matrix({$this->rows}x{$this->columns};" . substr($s, 0, -1) . ")";
}
}
}

View file

@ -104,15 +104,15 @@ class Vector3{
}
public function getSide($side, $step = 1){
return match ((int)$side) {
0 => new Vector3($this->x, $this->y - $step, $this->z),
1 => new Vector3($this->x, $this->y + $step, $this->z),
2 => new Vector3($this->x, $this->y, $this->z - $step),
3 => new Vector3($this->x, $this->y, $this->z + $step),
4 => new Vector3($this->x - $step, $this->y, $this->z),
5 => new Vector3($this->x + $step, $this->y, $this->z),
default => $this,
};
return match ((int)$side) {
0 => new Vector3($this->x, $this->y - $step, $this->z),
1 => new Vector3($this->x, $this->y + $step, $this->z),
2 => new Vector3($this->x, $this->y, $this->z - $step),
3 => new Vector3($this->x, $this->y, $this->z + $step),
4 => new Vector3($this->x - $step, $this->y, $this->z),
5 => new Vector3($this->x + $step, $this->y, $this->z),
default => $this,
};
}
public function distance($x = 0, $y = 0, $z = 0){
@ -270,4 +270,4 @@ class Vector3{
public function getIntermediateWithZValue(Vector3 $v, $y){
return $this->clipZ($v, $y);
}
}
}