sassy-math 0.1.1 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/sassy-math.gemspec +1 -1
  2. data/stylesheets/_math.scss +29 -28
  3. metadata +2 -2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sassy-math}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
8
8
  s.authors = ["Sam Richard", "Mario Valencia", "Scott Kellum"]
@@ -5,8 +5,8 @@
5
5
  //////////////////////////////
6
6
  // Variables
7
7
  //////////////////////////////
8
- $pi: pi();
9
- $π: pi();
8
+ $pi: 3.1415926535897932384626433832795028841971693993751;
9
+ $π: $pi;
10
10
  $e: 2.71828182845904523536028747135266249775724709369995;
11
11
 
12
12
  $iter: 50;
@@ -28,6 +28,20 @@ $iter: 50;
28
28
  @return $number * 0.01;
29
29
  }
30
30
 
31
+ //////////////////////////////
32
+ // Golden Ratio
33
+ //////////////////////////////
34
+ @function golden() {
35
+ @return 1/2 + sqrt(5) / 2;
36
+ }
37
+ @function ϕ() {
38
+ @return golden();
39
+ }
40
+
41
+ $golden: golden();
42
+ $gold: $golden;
43
+ $ϕ: $golden;
44
+
31
45
  //////////////////////////////
32
46
  // Exponent
33
47
  //////////////////////////////
@@ -102,29 +116,7 @@ $iter: 50;
102
116
  // Basic Trig Functions
103
117
  //////////////////////////////
104
118
 
105
- // BUILT INTO COMPASS :: http://compass-style.org/reference/compass/helpers/trig/
106
-
107
- //@function sin($number, $unit: 'deg') {
108
- // @if $unit == 'deg' {
109
- // $number: deg-to-rad($number);
110
- // }
111
- // @return maclaurin($number, 3, $number);
112
- //}
113
- //
114
- //@function cos($number, $unit: 'deg') {
115
- // @if $unit == 'deg' {
116
- // $number: deg-to-rad($number);
117
- // }
118
- // @return maclaurin(1, 2, $number);
119
- //}
120
- //
121
- // Trig Identity: Tangent = Sine divided by Cosine.
122
- //@function tan($number, $unit: 'deg') {
123
- // @if $unit == 'deg' {
124
- // $number: deg-to-rad($number);
125
- // }
126
- // @return sin($number) / cos($number);
127
- //}
119
+ // Bundled in compass: http://compass-style.org/reference/compass/helpers/trig/
128
120
 
129
121
  //////////////////////////////
130
122
  // Reciprocal Trig Functions
@@ -245,11 +237,20 @@ $iter: 50;
245
237
  }
246
238
  }
247
239
 
240
+ @function root($number, $n) {
241
+ @return n-root($number, $n);
242
+ }
243
+
248
244
  // Square Roots
249
245
  @function √($number) {
250
- @return n-root($number, 2);
246
+ @return sqrt($number);
251
247
  }
252
248
 
253
249
  @function sqrt($number) {
254
- @return n-root($number, 2);
255
- }
250
+ $guess: rand();
251
+ $root: $guess;
252
+ @for $i from 1 through $iter {
253
+ $root: $root - (pow($root, 2) - $number) / (2 * $root);
254
+ }
255
+ @return $root;
256
+ }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sam Richard