Permalink
Browse files

license clarifications, copyright date update

  • Loading branch information...
1 parent 7d3221b commit bcf66ae19039ceec5e6e2951eec4e139cb3e81fa @Resseguie Resseguie committed Apr 21, 2015
Showing with 40 additions and 3 deletions.
  1. +8 −1 LICENSE-MIT
  2. +32 −2 lib/fn.js
View
@@ -1,5 +1,5 @@
Copyright (c) 2012, 2013, 2014 Rick Waldron <waldron.rick@gmail.com>
-Copyright (c) 2014 The Johnny-Five Authors
+Copyright (c) 2014, 2015 The Johnny-Five Authors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -21,3 +21,10 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+All files located in the node_modules directory are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
View
@@ -1,5 +1,6 @@
-var lodash = require("lodash"),
- Fn = {
+var lodash = require("lodash");
+
+var Fn = {
assign: lodash.assign,
extend: lodash.extend,
defaults: lodash.defaults,
@@ -16,6 +17,7 @@ var lodash = require("lodash"),
// Based on arduino map()
//
// Return float
+//
Fn.fmap = function(value, fromLow, fromHigh, toLow, toHigh) {
return (value - fromLow) * (toHigh - toLow) /
(fromHigh - fromLow) + toLow;
@@ -30,6 +32,7 @@ Fn.fscale = Fn.fmap;
// Based on arduino map()
//
// Retun int
+//
Fn.map = function(value, fromLow, fromHigh, toLow, toHigh) {
return Fn.fmap(value, fromLow, fromHigh, toLow, toHigh) | 0;
};
@@ -41,6 +44,7 @@ Fn.scale = Fn.map;
//
// Constrains a number to be within a range.
// Based on arduino constrain()
+//
Fn.constrain = function(value, lower, upper) {
return Math.min(upper, Math.max(lower, value));
};
@@ -124,6 +128,32 @@ Fn.sum = function sum(values) {
// fma function
// Copyright (c) 2012, Jens Nockert
// All rights reserved.
+// Distributed under the Simplified BSD license.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+//
Fn.fma = function(a, b, c) {
var aHigh = 134217729 * a;
var aLow;

0 comments on commit bcf66ae

Please sign in to comment.