protected function Rectangle::delta in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Utility/Rectangle.php \Drupal\Component\Utility\Rectangle::delta()
- 10 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.
1 call to Rectangle::delta()
- Rectangle::fixImprecision in core/
lib/ Drupal/ Component/ Utility/ Rectangle.php - Performs an imprecision check on the input value and fixes it if needed.
File
- core/
lib/ Drupal/ Component/ Utility/ Rectangle.php, line 170
Class
- Rectangle
- Rectangle rotation algebra class.
Namespace
Drupal\Component\UtilityCode
protected function delta($input) {
$fraction = $this
->fraction($input);
return $fraction > 0.5 ? 1 - $fraction : $fraction;
}