Created
December 4, 2014 15:18
-
-
Save leonderijke/b0a1d4e656b743910156 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
$pi: 3.14159265359; | |
@function pow($base,$exp){ | |
$value: $base; | |
@if $exp > 1{ | |
@for $i from 2 through $exp{ | |
$value: $value * $base; | |
} | |
} | |
@if $exp < 1{ | |
@for $i from 0 through -$exp{ | |
$value: $value / $base; | |
} | |
} | |
@return $value; | |
} | |
@function fact($val){ | |
$value: 1; | |
@if $val > 0{ | |
@for $i from 1 through $val{ | |
$value: $value * $i; | |
} | |
} | |
@return $value; | |
} | |
@function sin($angle, $degrees: false){ | |
$sin: 0; | |
@if $degrees{ | |
$angle: $angle / 180 * $pi; | |
} | |
@for $n from 1 through 10{ | |
$sin: $sin + ( pow(-1,$n) / fact(2*$n+1) ) * pow($angle,(2*$n+1)); | |
} | |
@return $sin; | |
} | |
@function cos($angle, $degrees: false){ | |
$cos: 0; | |
@if $degrees{ | |
$angle: $angle / 180 * $pi; | |
} | |
@for $n from 1 through 10{ | |
$cos: $cos + ( pow(-1,$n) / fact(2*$n) ) * pow($angle,2*$n); | |
} | |
@return $cos; | |
} | |
@function tan($angle, $degrees: false){ | |
@if $degrees{ | |
$angle: $angle / 180 * $pi; | |
} | |
$tan: sin($angle) / cos($angle); | |
@return $tan; | |
} | |
$width: 100px; | |
$height: 300px; | |
$top-height: 70px; | |
$bottom-height: $height - $top-height; | |
$angle: 10; | |
$x: ( -$height - $top-height ) / (tan($angle) + ($top-height / $width)); | |
$y: ($height / $width) * $x - $height; | |
.Foo { | |
x: $x; | |
y: $y; | |
t: tan($angle, true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.Foo { | |
x: 640.21744px; | |
y: 1620.65231px; | |
t: 0.05824; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment