You are here

protected function Rectangle::delta in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Utility/Rectangle.php \Drupal\Component\Utility\Rectangle::delta()
  2. 9 core/lib/Drupal/Component/Utility/Rectangle.php \Drupal\Component\Utility\Rectangle::delta()

Returns the difference of a fraction from the closest between 0 and 1.

Parameters

float $input: The input value.

Return value

float the difference of a fraction from the closest between 0 and 1.

File

core/lib/Drupal/Component/Utility/Rectangle.php, line 170

Class

Rectangle
Rectangle rotation algebra class.

Namespace

Drupal\Component\Utility

Code

protected function delta($input) {
  $fraction = $this
    ->fraction($input);
  return $fraction > 0.5 ? 1 - $fraction : $fraction;
}