[Jspro-cvs] jsPro README,1.26,1.27 math.js,1.25,1.26 CHANGES,1.21,1.22
Brought to you by:
wigleys
|
From: <wi...@us...> - 2003-10-13 08:57:50
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv31570
Modified Files:
README math.js CHANGES
Log Message:
three new math methods - versh(), covh(), havh()
Index: README
===================================================================
RCS file: /cvsroot/jspro/jsPro/README,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** README 6 Oct 2003 12:24:05 -0000 1.26
--- README 13 Oct 2003 08:57:46 -0000 1.27
***************
*** 128,218 ****
80. Math.coth(): hyperbolic cotangent
81. Math.cov(): coversine
! 82. Math.csc(): cosecant
! 83. Math.csch(): hyperbolic cosecant
! 84. Math.dec2bin(): decimal to binary conversion
! 85. Math.dec2hex(): decimal to hexadecimal conversion
! 86. Math.dec2oct(): decimal to octal conversion
! 87. Math.deg2grad(): degree to gradian conversion
! 88. Math.deg2rad(): degree to radian conversion
! 89. Math.exp10(): exponent of 10
! 90. Math.expm1(): exp(x) - 1
! 91. Math.exsec(): exsecant
! 92. Math.factorial(): factorial
! 93. Math.fibonacci(): Fibonacci sequence
! 94. Math.fmod(): floating-point remainder
! 95. Math.gd(): Gudermannian function
! 96. Math.grad2deg(): gradian to degree conversion
! 97. Math.grad2rad(): gradian to radian conversion
! 98. Math.hac(): hacoversine
! 99. Math.hav(): haversine
! 100. Math.hex2bin(): hexadecimal to binary conversion
! 101. Math.hex2dec(): hexadecimal to decimal conversion
! 102. Math.hex2oct(): hexadecimal to octal conversion
! 103. Math.hypot(): hypotenuse
! 104. Math.isEven(): is even?
! 105. Math.isOdd(): is odd?
! 106. Math.isPrime(): is prime?
! 107. Math.log10(): base-10 logarithm
! 108. Math.log2(): base-2 logarithm
! 109. Math.log1p(): log(1 + x)
! 110. Math.luhn(): LUHN formula
! 111. Math.mantissa(): mantissa
! 112. Math.oct2bin(): octal to binary conversion
! 113. Math.oct2dec(): octal to decimal conversion
! 114. Math.oct2hex(): octal to hexadecimal conversion
! 115. Math.pi(): calculate pi
! 116. Math.rad2deg(): radian to degree conversion
! 117. Math.rad2grad(): radian to gradian conversion
! 118. Math.sec(): secant
! 119. Math.sech(): hyperbolic secant
! 120. Math.sigmoid(): sigmoid function
! 121. Math.sign(): sign
! 122. Math.sinc(): sinc function
! 123. Math.sinh(): hyperbolic sine
! 124. Math.sq(): square
! 125. Math.tanc(): tanc function
! 126. Math.tanh(): hyperbolic tangent
! 127. Math.vers(): versine
point.js
-------------------------------------------------------------------------------
! 128. Point.prototype.distance(): distance between two points
string.js
-------------------------------------------------------------------------------
! 129. String.prototype.addSlashes(): escape certain characters with backslashes
! 130. String.prototype.cat(): concatenate
! 131. String.prototype.compress(): compress whitespace to single spaces
! 132. String.prototype.count(): count occurrence of characters
! 133. String.prototype.htmlEntities(): encode XHTML 1.0 entities
! 134. String.prototype.htmlSpecialChars(): encode subset of HTML special characters
! 135. String.prototype.insert(): insert one string into another
! 136. String.prototype.isEmailAddress(): is email address?
! 137. String.prototype.levenshtein(): Levenshtein distance
! 138. String.prototype.lpad(): pad left side
! 139. String.prototype.ltrim(): trim left side
! 140. String.prototype.nl2br(): newline to <br> conversion
! 141. String.prototype.overlay(): overlay one string over another
! 142. String.prototype.pad(): pad
! 143. String.prototype.remove(): remove characters
! 144. String.prototype.repeat(): repeat
! 145. String.prototype.repeatChars(): repeat characters
! 146. String.prototype.reverse(): reverse
! 147. String.prototype.rot13(): rotate 13 encoding
! 148. String.prototype.rpad(): pad right side
! 149. String.prototype.rtrim(): trim right side
! 150. String.prototype.swap(): swap characters
! 151. String.prototype.trim(): trim
! 152. String.prototype.truncate(): truncate
! 153. String.prototype.ucFirst(): uppercase first character
! 154. String.prototype.ucWords(): uppercase words
! 155. String.prototype.wordWrap(): word wrap
validator.js
-------------------------------------------------------------------------------
! 156. Validator.prototype.isBlankString(): is blank string?
! 157. Validator.prototype.isDigit(): is single digit?
! 158. Validator.prototype.isInteger(): is integer?
! This file was generated automatically: Mon Oct 6 13:26:11 2003
\ No newline at end of file
--- 128,221 ----
80. Math.coth(): hyperbolic cotangent
81. Math.cov(): coversine
! 82. Math.covh(): hyperbolic coversine
! 83. Math.csc(): cosecant
! 84. Math.csch(): hyperbolic cosecant
! 85. Math.dec2bin(): decimal to binary conversion
! 86. Math.dec2hex(): decimal to hexadecimal conversion
! 87. Math.dec2oct(): decimal to octal conversion
! 88. Math.deg2grad(): degree to gradian conversion
! 89. Math.deg2rad(): degree to radian conversion
! 90. Math.exp10(): exponent of 10
! 91. Math.expm1(): exp(x) - 1
! 92. Math.exsec(): exsecant
! 93. Math.factorial(): factorial
! 94. Math.fibonacci(): Fibonacci sequence
! 95. Math.fmod(): floating-point remainder
! 96. Math.gd(): Gudermannian function
! 97. Math.grad2deg(): gradian to degree conversion
! 98. Math.grad2rad(): gradian to radian conversion
! 99. Math.hac(): hacoversine
! 100. Math.hav(): haversine
! 101. Math.havh(): hyperbolic haversine
! 102. Math.hex2bin(): hexadecimal to binary conversion
! 103. Math.hex2dec(): hexadecimal to decimal conversion
! 104. Math.hex2oct(): hexadecimal to octal conversion
! 105. Math.hypot(): hypotenuse
! 106. Math.isEven(): is even?
! 107. Math.isOdd(): is odd?
! 108. Math.isPrime(): is prime?
! 109. Math.log10(): base-10 logarithm
! 110. Math.log2(): base-2 logarithm
! 111. Math.log1p(): log(1 + x)
! 112. Math.luhn(): LUHN formula
! 113. Math.mantissa(): mantissa
! 114. Math.oct2bin(): octal to binary conversion
! 115. Math.oct2dec(): octal to decimal conversion
! 116. Math.oct2hex(): octal to hexadecimal conversion
! 117. Math.pi(): calculate pi
! 118. Math.rad2deg(): radian to degree conversion
! 119. Math.rad2grad(): radian to gradian conversion
! 120. Math.sec(): secant
! 121. Math.sech(): hyperbolic secant
! 122. Math.sigmoid(): sigmoid function
! 123. Math.sign(): sign
! 124. Math.sinc(): sinc function
! 125. Math.sinh(): hyperbolic sine
! 126. Math.sq(): square
! 127. Math.tanc(): tanc function
! 128. Math.tanh(): hyperbolic tangent
! 129. Math.vers(): versine
! 130. Math.versh(): hyperbolic versine
point.js
-------------------------------------------------------------------------------
! 131. Point.prototype.distance(): distance between two points
string.js
-------------------------------------------------------------------------------
! 132. String.prototype.addSlashes(): escape certain characters with backslashes
! 133. String.prototype.cat(): concatenate
! 134. String.prototype.compress(): compress whitespace to single spaces
! 135. String.prototype.count(): count occurrence of characters
! 136. String.prototype.htmlEntities(): encode XHTML 1.0 entities
! 137. String.prototype.htmlSpecialChars(): encode subset of HTML special characters
! 138. String.prototype.insert(): insert one string into another
! 139. String.prototype.isEmailAddress(): is email address?
! 140. String.prototype.levenshtein(): Levenshtein distance
! 141. String.prototype.lpad(): pad left side
! 142. String.prototype.ltrim(): trim left side
! 143. String.prototype.nl2br(): newline to <br> conversion
! 144. String.prototype.overlay(): overlay one string over another
! 145. String.prototype.pad(): pad
! 146. String.prototype.remove(): remove characters
! 147. String.prototype.repeat(): repeat
! 148. String.prototype.repeatChars(): repeat characters
! 149. String.prototype.reverse(): reverse
! 150. String.prototype.rot13(): rotate 13 encoding
! 151. String.prototype.rpad(): pad right side
! 152. String.prototype.rtrim(): trim right side
! 153. String.prototype.swap(): swap characters
! 154. String.prototype.trim(): trim
! 155. String.prototype.truncate(): truncate
! 156. String.prototype.ucFirst(): uppercase first character
! 157. String.prototype.ucWords(): uppercase words
! 158. String.prototype.wordWrap(): word wrap
validator.js
-------------------------------------------------------------------------------
! 159. Validator.prototype.isBlankString(): is blank string?
! 160. Validator.prototype.isDigit(): is single digit?
! 161. Validator.prototype.isInteger(): is integer?
! This file was generated automatically: Mon Oct 13 09:54:52 2003
\ No newline at end of file
Index: math.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/math.js,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** math.js 6 Oct 2003 12:21:32 -0000 1.25
--- math.js 13 Oct 2003 08:57:46 -0000 1.26
***************
*** 1166,1169 ****
--- 1166,1213 ----
/**
+ * Calculates and returns the hyperbolic coversine of a number in 2D Cartesian
+ * space.
+ *
+ * @summary hyperbolic coversine
+ * @author Stuart Wigley
+ * @version 1.0, 10/13/03
+ * @interface <code>Math.covh(fX)</code>
+ * @param fX a floating-point number
+ * @return the hyperbolic coversine of <code>fX</code>
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ * @throws TypeMismatchException
+ */
+ Math.covh = function(fX) {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+
+ if (iNumArguments != 1) {
+ throw vError = new IllegalArgumentException('Math.covh', 1, iNumArguments);
+ }
+
+ if (typeof fX != 'number') {
+ throw vError = new TypeMismatchException('Math.covh', 'number', typeof fX);
+ }
+
+ var fHypCoversine = 1 - ((Math.exp(fX) - Math.exp(-fX)) / 2);
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : fHypCoversine;
+ }
+ }
+
+
+ /**
* Calculates and returns the cosecant of a number in 2D Cartesian space.
*
***************
*** 1969,1972 ****
--- 2013,2060 ----
/**
+ * Calculates and returns the hyperbolic haversine of a number in 2D Cartesian
+ * space.
+ *
+ * @summary hyperbolic haversine
+ * @author Stuart Wigley
+ * @version 1.0, 10/13/03
+ * @interface <code>Math.havh(fX)</code>
+ * @param fX a floating-point number
+ * @return the hyperbolic haversine of <code>fX</code>
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ * @throws TypeMismatchException
+ */
+ Math.havh = function(fX) {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+
+ if (iNumArguments != 1) {
+ throw vError = new IllegalArgumentException('Math.havh', 1, iNumArguments);
+ }
+
+ if (typeof fX != 'number') {
+ throw vError = new TypeMismatchException('Math.havh', 'number', typeof fX);
+ }
+
+ var fHypHaversine = (1 - ((Math.exp(fX) + Math.exp(-fX)) / 2)) / 2;
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : fHypHaversine;
+ }
+ }
+
+
+ /**
* Converts a hexadecimal number into its binary equivalent.
*
***************
*** 3281,3284 ****
--- 3369,3416 ----
return vError ? null : fVersine;
+ }
+ }
+
+
+ /**
+ * Calculates and returns the hyperbolic versine of a number in 2D Cartesian
+ * space.
+ *
+ * @summary hyperbolic versine
+ * @author Stuart Wigley
+ * @version 1.0, 10/13/03
+ * @interface <code>Math.versh(fX)</code>
+ * @param fX a floating-point number
+ * @return the hyperbolic versine of <code>fX</code>
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ * @throws TypeMismatchException
+ */
+ Math.versh = function(fX) {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+
+ if (iNumArguments != 1) {
+ throw vError = new IllegalArgumentException('Math.versh', 1, iNumArguments);
+ }
+
+ if (typeof fX != 'number') {
+ throw vError = new TypeMismatchException('Math.versh', 'number', typeof fX);
+ }
+
+ var fHypVersine = 1 - ((Math.exp(fX) + Math.exp(-fX)) / 2);
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : fHypVersine;
}
}
Index: CHANGES
===================================================================
RCS file: /cvsroot/jspro/jsPro/CHANGES,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** CHANGES 6 Oct 2003 12:21:32 -0000 1.21
--- CHANGES 13 Oct 2003 08:57:46 -0000 1.22
***************
*** 1,4 ****
===============================================================================
! Whats new in R2? (Not Released Yet)
===============================================================================
--- 1,4 ----
===============================================================================
! Whats new in R4? (Not Released Yet)
===============================================================================
***************
*** 12,18 ****
--- 12,21 ----
- Math.avers()
- Math.coexsec()
+ - Math.covh()
- Math.factorial()
- Math.hac()
+ - Math.havh()
- Math.mantissa()
+ - Math.versh()
===============================================================================
|