Tuesday, March 26, 2013

Java;Notes - 8.) Java Mathematics Functions

Java has a nifty little built in math function library that if you want to use with out typing the whole Math.functionHere you can simply import the following line:
  • import static java.lang.Math.*;
Doing this will make it so you no longer have to type out the full function so instead of doing Square Roots like: "Math.sqrt" you would simply just use "sqrt" Since we are on the topic of diffrent kinds of math operations lets take a look at what else java can offer us:
  • Math.pow (For raising the power of a number)
  • Math.sin
  • Math.cos
  • Math.tan
  • Math.atan
  • Math.atan2
  • Math.exp
  • Math.log
  • Math.log10
  • Math.PI
  • Math.E
Most of these we have run into in math class and we know what they mean so no real explanation needs to be given to the list.