Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

double

Find X, Y intersection of 2 lines
Friday, 17 February 2012 10:17
// Find X,Y intersection of 2 lines


public class findLineIntersection {

public static void main(String args[]){
//Ay = Bx + C
//Dy = Ex + F
double A,B,C,D,E,F;

A=1; B=2; C=3; D=4; E=5; F=6;

double X = findX(A,B,C,D,E,F);
double Y = findY(A,B,C,X);

System.out.println("("+X+","+Y+")");
}

public static double findX(double A, double B, double C, double D, double E, double F){
double neg =-1;
double Q,R,S;
if (A<0 ^ D<0){
//If A or D is negative add the values
neg = 1;
}
//Eliminate Y using multiple
double multiple = neg*(A/D);
D = D*multiple;
E = E*multiple;
F = F*multiple;

//Q will be 0
Q = A+D;
R = B+E;
S = C+F;
return (-S)/R;
}
public static double findY(double A, double B, double C, double X){
return ((B*X) + C)/A;
}
}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/itq7XBPyPRE/14687

 
Find X, Y intercepts of a line
Friday, 17 February 2012 09:37
//Finds X, Y intercepts of a line

public class findIntercepts {
//Finds X and Y intercepts for a line
public static void main (String args[]){
//input: Ax + By = C
double A =5;
double B =5;
double C =5;
System.out.println("X intercept: ("+findXIntercept(A,C)+ ",0)");
System.out.println("Y intercept: (0,"+findYIntercept(B,C)+")");
}
public static Object findXIntercept(double A, double C){
if (A==0){
return null;
}
else {
return C/A;
}
}
public static Object findYIntercept(double B, double C){
if (B==0){
return null;
}
else{
return C/B;
}
}
}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/glp1w83_m54/14685

 
Calculate SD
Monday, 20 June 2011 02:25
this simple program will calculate the SD(standard deviation) for the given input.


public class StandardDeviation{
public static double mean ( double[] data )

{

double mean = 0;
final int n = data.length;
if ( n < 2 )
return Double.NaN;
for ( int i=0; i mean += data[i];
mean /= n;
double sum = 0;
for ( int i=0; i {
final double v = data[i] - mean;
sum += v * v;
}
return Math.sqrt( sum / ( n - 1 ) );
}
public static double sd ( double[] data ){

final int n = data.length;

if ( n < 2 )
return Double.NaN;
double avg = data[0];
double sum = 0;
for ( int i = 1; i < data.length; i++ )
{
double newavg = avg + ( data[i] - avg ) / ( i + 1 );
sum += ( data[i] - avg ) * ( data [i] -newavg ) ;
avg = newavg;
}
return Math.sqrt( sum / ( n - 1 ) );
}
public static void main ( String[] args )
{
double[] data = { 10, 100 , 50};
System.out.println(mean(data));
System.out.println(sd (data));
}
}

Know more theory about standard deviation Standard Deviation Calculator

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/THZ8HzwuVxs/13271

 
Triple Decker Oreo Signals Man's Progress Toward Superhuman Destiny [Omg]
Friday, 13 May 2011 20:20
What would it take to make the Oreo—perhaps the most architecturally perfect dessert, ever—look like garbage? Another layer of cookie. The Triple Double Oreo, out this summer, is the cookie version of the 2001: A Space Odyssey monolith. More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/tU89hpoi6tk/triple-decker-oreo-signals-mans-progress-toward-superhuman-destiny

 
Hasbro's Goofy MY3D Goggles Are Better than They Look [Toys]
Friday, 01 April 2011 18:20
The iPhone can't do 3D—that might be a great thing!—but it's reality. Hasbro's got a workaround—strapping your phone to a pair of big plastic goggles that convert an on-screen double image into a stereoscopic effect. It's surprisingly fun! More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/sh3ABDWdN6Q/hasbros-goofy-my3d-goggles-are-cooler-than-they-look

 


Taxonomy by Zaragoza Online