Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/vendor/bacon/bacon-qr-code/src/Renderer/Path/ |
Upload File : |
<?php declare(strict_types = 1); namespace BaconQrCode\Renderer\Path; final class Line implements OperationInterface { public function __construct(private readonly float $x, private readonly float $y) { } public function getX() : float { return $this->x; } public function getY() : float { return $this->y; } /** * @return self */ public function translate(float $x, float $y) : OperationInterface { return new self($this->x + $x, $this->y + $y); } /** * @return self */ public function rotate(int $degrees) : OperationInterface { $radians = deg2rad($degrees); $sin = sin($radians); $cos = cos($radians); $xr = $this->x * $cos - $this->y * $sin; $yr = $this->x * $sin + $this->y * $cos; return new self($xr, $yr); } }