尝试将以下 php 方法转换为在 .less 样式表中使用:
<?php
$deg2radians = pi() * 2 / 360;
$rad = $degree * $deg2radians;
$costheta = cos($rad);
$sintheta = sin($rad);
?>
在 Less 中,我如何在不使用特定语言的 cos()/sin() 函数的情况下实现正弦/余弦方法?
.rotate(@deg) {
// css transform capable browsers properties...
// IE <= 8
@deg2radians: 3.1416 * 2 / 360;
@rad: @degree * @deg2radians;
@sintheta: sin(@rad); // How to sin()?
@costheta: cos(@rad); // How to cos()?
// filter: transform matrix method...
}