Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: tracing/tracing/base/math.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tracing/tracing/base/iteration_helpers.html ('k') | tracing/tracing/base/range.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 <link rel="import" href="/tracing/base/base.html"> 7 <link rel="import" href="/tracing/base/base.html">
8 <script src="/gl-matrix-min.js"></script> 8 <script src="/gl-matrix-min.js"></script>
9 9
10 <script> 10 <script>
(...skipping 13 matching lines...) Expand all
24 global[exportName] = glMatrixModule[exportName]; 24 global[exportName] = glMatrixModule[exportName];
25 } 25 }
26 } 26 }
27 })(this); 27 })(this);
28 </script> 28 </script>
29 29
30 <script> 30 <script>
31 'use strict'; 31 'use strict';
32 32
33 tr.exportTo('tr.b', function() { 33 tr.exportTo('tr.b', function() {
34 /* Returns true when x and y are within delta of each other. */
35 function approximately(x, y, delta) {
36 if (delta === undefined)
37 delta = 1e-9;
38 return Math.abs(x - y) < delta;
39 }
40
34 function clamp(x, lo, hi) { 41 function clamp(x, lo, hi) {
35 return Math.min(Math.max(x, lo), hi); 42 return Math.min(Math.max(x, lo), hi);
36 } 43 }
37 44
38 function lerp(percentage, lo, hi) { 45 function lerp(percentage, lo, hi) {
39 var range = hi - lo; 46 var range = hi - lo;
40 return lo + percentage * range; 47 return lo + percentage * range;
41 } 48 }
42 49
43 function normalize(value, lo, hi) { 50 function normalize(value, lo, hi) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 out[3] = 1; 156 out[3] = 1;
150 return out; 157 return out;
151 }; 158 };
152 159
153 vec2.copyFromVec4 = function(out, a) { 160 vec2.copyFromVec4 = function(out, a) {
154 vec4.unitize(tmp_vec4, a); 161 vec4.unitize(tmp_vec4, a);
155 vec2.copy(out, tmp_vec4); 162 vec2.copy(out, tmp_vec4);
156 }; 163 };
157 164
158 return { 165 return {
166 approximately: approximately,
159 clamp: clamp, 167 clamp: clamp,
160 lerp: lerp, 168 lerp: lerp,
161 normalize: normalize, 169 normalize: normalize,
162 deg2rad: deg2rad, 170 deg2rad: deg2rad,
163 erf: erf 171 erf: erf
164 }; 172 };
165 }); 173 });
166 </script> 174 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/base/iteration_helpers.html ('k') | tracing/tracing/base/range.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698