PHYSICS WORKSHEET (transcribed)

Saturday, February 27, 2010
hi guys. david here. challenge to self: transcribe physics worksheet into blog entry. :))

Formulae:

Stress = Force / Area
Units for Stress: Pa (pascal) or N/m^2

Strain = Change in Length / Original Length
Units for Strain: none

Area of a Cylinder or Rod = Pi x Diameter^2 divided by 4

Elastic Limit = maximum stress a body can take without deformation
Refer to "Stress = F/A"

Modulus of Elasticity = Stress / Strain
Units for Modulus: Pa

Young's Modulus = longitudinal stress / longitudinal strain
Use this for objects like rods and bars which are much longer than they are wide
Y = (F / A) / (change in L / L) or (FL)/(A x change in L)
Units: Pa

Shear Modulus = ratio of shearing stress (F/A) to shearing strain (theta, also distance/length), in other words, (F/A) divided by (d/l)




WORKSHEET QUESTIONS:

1.) A woman wearing high-heeled shoes is invited into a home in which the kitchen has vinyl floor covering. Why should the homeowner be worried?

Hint: Stress is calculated by (Force divided by Area)

2.) If the elastic limit of steel is 2.48 x 10^8 Pa, determine the minimum diameter a steel wire can have if it is to support a 70kg circus performer without its elastic limit being reached.

Hint: use Stress = F/A, then calculate for D using the formula above (area of steel rod)

3.) For safety in climbing, a mountaineer uses a nylon rope that is 50m long and 1.0cm in diameter. When supporting a 90 kg climber, the rope elongates 1.6 m. Find its Young's Modulus.

Hint: Solve for area using given diameter, then apply Y = (FL)/(A x change in L). Your answer is going to be a big number.

4.) The distortion of the Earth's crustal plates is an example of shear on a larger scale. (HAHAHA. Aliw naman ako.) A particular crustal rock has a shear modulus of 1.5 x 10^10 Pa. What shear stress is involved when a 10-km layer of this rock is sheared through a distance of 5.0 m?

Hint: Use Shearing modulus = Stress / (d/l)





Good luck, people :> Sana naintindihan niyo yung mga formula sa taas.
Read On 8 comments

Perio week! Last week reminders. :(

Friday, February 26, 2010
Noooo. :( Patapos na talaga. :|

STR
- Final Proposal due on Monday, March 8.

- LabJournals! (HANNAH! Kailangan mong hanapin yun! >_<)

Bio
- Reproductive System HW due on Monday, March 1.
- Frog dissection on Monday, March 8.

CS
- Snake Applet due on Monday, March 8.

Phyics
- LabReport on Center of Gravity due on Monday March 1.
- Homeworks/Take Home LT also due on Monday, March 1.


... Because I haven't posted it yet. Refer to Sodium's post for the questions for the meantime.




Chem
- Longtest on Monday, March 1.

English
- Essays (+- 300 words) due on Tuesday, March 2.
- Wala pa rin na-oust sa atin. :P

Socsci
- Quiz on Wars Part 2 on Tuesday, March 2.
- Optional Viewing of Election Vids during Clearance Week.

Health
- Make up classes on Monday and Tuesday
- Hallucinogens and Stimulants Report

Others
- Bulletin Board! Hoy, tapusin na natin 'to! =))
- Year-end Party! :D

Meron pa ba? XD
Read On 1 comments

Bio Data

Saturday, February 20, 2010
Stem Elongation


1 PPM GA3
10 PPM GA3100 PPM GA3H2O

InitialFinalInitial
FinalInitial
FinalInitial
Final
Sr-045.73cm28.22cm6.77cm28.24cm8.97cm34.92cm5.33cm28.06cm
(Terence)1.9in
12.1in
1.5in11.2in2.4in
14.7in
3.0in
11.4 in
(Domz)
5.52cm24.90cm5.30cm30.71cm5.65cm31.21cm4.05cm24.59cm

Fruit Ripening


Rate of Fruit Ripening (1-slowest, 3-fastest)

1 apple
2 apples
No apples
Sr-012
3
1
Sr-021
3
2
(David)Same speed
Read On 11 comments

Isang week nalang! :(

Friday, February 19, 2010
Ibig sabihin, hell week na.

STR
- Oral Defense
- Mini-Research Proposal
- Make-up Class

Bio
- Plant Hormones Lab Report
- Email your data to cpd1994@yahoo.com

Fil
- Original Dula
- Writing period from now on. *dance*

Physics
- Worksheet

Eng
- Poem reports
- Essay (+- 300 words, about your supernatural power)

CS
- Snake Applet (by group)

Health
- Reportings

SS
- SS Video about voting

Read On 4 comments

CS Keyboard Inputs

Thursday, February 18, 2010
Tatlo yung in-email ni Sir Paolo. :O



//

import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.awt.event.*;


/**
* Class Keyboard - write a description of the class here
*
* @author (your name)
* @version (a version number)
*/
public class Keyboard extends JApplet implements KeyListener, MouseListener, MouseMotionListener
{
int width=500, height=500;
int x, y;
String s = "";

public void mouseEntered( MouseEvent e ) { }
public void mouseExited( MouseEvent e ) { }
public void mousePressed( MouseEvent e ) { }
public void mouseReleased( MouseEvent e ) { }
public void mouseMoved( MouseEvent e ) { }
public void mouseDragged( MouseEvent e ) { }
public void mouseClicked( MouseEvent e ) {
x = e.getX();
y = e.getY();
s = "";
repaint();
}

public void keyPressed( KeyEvent e ) { }
public void keyReleased( KeyEvent e ) { }
public void keyTyped( KeyEvent e ) {
char c = e.getKeyChar();
s = s + c;
repaint();

}


/**
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
*/
public void init()
{
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// provide any initialisation necessary for your JApplet

addKeyListener( this );
addMouseListener( this );

}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
*/
public void start()
{
// provide any code requred to run each time
// web page is visited
}

/**
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
*/
public void stop()
{
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
}

/**
* Paint method for applet.
*
* @param g the Graphics object for this applet
*/
public void paint(Graphics g)
{
g.setColor( Color.black );
g.drawLine( x, y, x, y-10 );
g.setColor( Color.blue );

//Font(name,style,size);
//Styles: Font.BOLD, PLAIN, ITALIC
g.setFont(new Font("Default",Font.BOLD,20));
g.drawString( s, x, y );

}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
*/
public void destroy()
{
// provide code to be run when JApplet is about to be destroyed.
}


/**
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
*
* @return a String representation of information about this JApplet
*/
public String getAppletInfo()
{
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
}


/**
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
*
* @return a String[] representation of parameter information about this JApplet
*/
public String[][] getParameterInfo()
{
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
};
return paramInfo;
}
}




import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.awt.event.*;


/**
* Class Keyboard - write a description of the class here
*
* @author (your name
* @version (a version number)
*/
public class Keyboard2 extends JApplet implements KeyListener
{
int width=500, height=500;
int x=200, y=200;

public void keyPressed( KeyEvent e ) {
char c = e.getKeyChar();
if ( c == 'w') {
y--;
repaint();
} else if ( c == 'a') {
x--;
repaint();
} else if ( c == 'd') {
x++;
repaint();
} else if ( c == 's') {
y++;
repaint();
}
showStatus(x+","+y);
}
public void keyReleased( KeyEvent e ) { }
public void keyTyped( KeyEvent e ) { }


/**
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
*/
public void init()
{
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// provide any initialisation necessary for your JApplet

addKeyListener( this );

}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
*/
public void start()
{
// provide any code requred to run each time
// web page is visited
}

/**
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
*/
public void stop()
{
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
}

/**
* Paint method for applet.
*
* @param g the Graphics object for this applet
*/
public void paint(Graphics g)
{
g.setColor( Color.white );
g.fillRect( 0, 0, 500,500 );

g.setColor( Color.blue );
g.fillRect( x, y, 50,50 );


}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
*/
public void destroy()
{
// provide code to be run when JApplet is about to be destroyed.
}


/**
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
*
* @return a String representation of information about this JApplet
*/
public String getAppletInfo()
{
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
}


/**
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
*
* @return a String[] representation of parameter information about this JApplet
*/
public String[][] getParameterInfo()
{
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
};
return paramInfo;
}
}
//


//
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Keyboard3 extends JApplet implements MouseListener, MouseMotionListener, KeyListener {
// instance variables - replace the example below with your own
int width=500, height=500;
int mx, my; // the mouse coordinates
boolean isButtonPressed = false,loaded = false;
Color theColor = new Color(0,0,0);
String s = "";

public void keyPressed( KeyEvent e ) { }
public void keyReleased( KeyEvent e ) { }
public void keyTyped( KeyEvent e ) {
char c = e.getKeyChar();
if ( c != KeyEvent.CHAR_UNDEFINED ) {
s = s + c;
repaint();
}
}

public void mouseEntered( MouseEvent e ) {
// called when the pointer enters the applet's rectangular area
}

public void mouseExited( MouseEvent e ) {
// called when the pointer leaves the applet's rectangular area
}

public void mouseClicked( MouseEvent e ) {
// called after a press and release of a mouse button
// with no motion in between
// (If the user presses, drags, and then releases, there will be
// no click event generated.)


repaint();
}

public void mousePressed( MouseEvent e ) { // called after a button is pressed down
isButtonPressed = true;
//setBackground( Color.gray );

if(mx > 50 && mx < 100 && my > 50 && my < 100){
theColor = Color.red;
}

if(mx > 50 && mx < 100 && my > 125 && my < 175){
theColor = Color.green;
}

if(mx > 50 && mx < 100 && my > 200 && my < 250){
theColor = Color.blue;
}

if(mx > 25 && mx < 125 && my > 400 && my < 450){
s = "";
}

repaint();
}

public void mouseReleased( MouseEvent e ) { // called after a button is released
isButtonPressed = false;
}

public void mouseMoved( MouseEvent e ) { // called during motion when no buttons are down
mx = e.getX();
my = e.getY();
showStatus( "Mouse at (" + mx + "," + my + ")" );
repaint();
}

public void mouseDragged( MouseEvent e ) { // called during motion with buttons down
mx = e.getX();
my = e.getY();
showStatus( "Mouse at (" + mx + "," + my + ")" );
repaint();
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
*/
public void init()
{
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

mx = 0;
my = 0;

addMouseListener( this );
addMouseMotionListener( this );
addKeyListener( this );
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
*/
public void start()
{
}

/**
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
*/
public void stop()
{
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
}

/**
* Paint method for applet.
*
* @param g the Graphics object

* for this applet
*/
public void paint(Graphics g)
{
if(!loaded){
g.setColor(Color.gray);
g.fillRect(0,0,250,500);

g.setColor(Color.red);
g.fillRect(50,50,50,50);

g.setColor(Color.green);
g.fillRect(50,125,50,50);

g.setColor(Color.blue);
g.fillRect(50,200,50,50);

g.setColor( theColor );
g.fillRect(25,275,100,100);

g.setColor( Color.white );
g.fillRect(25,400,100,50);

g.setColor( Color.black );
g.drawRect(25,400,100,50);
g.drawString("Clear",55,425);

loaded = true;
}

if ( isButtonPressed && mx > width/2) {

g.setColor( theColor );
g.drawString(s,mx-5, my-5);

}
else if ( isButtonPressed && mx < width/2){
g.setColor( theColor );
g.fillRect(25,275,100,100);
}
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
*/
public void destroy()
{
// provide code to be run when JApplet is about to be destroyed.
}


/**
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
*
* @return a String representation of information about this JApplet
*/
public String getAppletInfo()
{
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
}


/**
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
*
* @return a String[] representation of parameter information about this JApplet
*/
public String[][] getParameterInfo()
{
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
};
return paramInfo;
}
}
//


//
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;

/**
* Class Animate - write a description of the class here
*
* @author (your name)
* @version (a version number)
*/
public class Animate2 extends JApplet implements Runnable,KeyListener
{
// instance variables - replace the example below with your own
int width, height;
int y = 0,x = 0;
String direction = "down";
Thread t = null;

public void keyPressed( KeyEvent e ) { }
public void keyReleased( KeyEvent e ) { }
public void keyTyped( KeyEvent e ) {
char c = e.getKeyChar();
if ( c == 'w') {
direction = "up";
} else if ( c == 'a') {
direction = "left";
} else if ( c == 'd') {
direction = "right";
} else if ( c == 's') {
direction = "down";
}
}


public void run() {
//runs simultaneously with the applet's methods
try {
while (true) {
if(direction == "up"){
y--;
} else if(direction == "down"){
y++;
} else if(direction == "left"){
x--;
} else if(direction == "right"){
x++;
}

if ( y == 11 ) {
y = 0;
}

if ( x == 11 ) {
x = 0;
}

if ( y == -1 ) {
y = 10;
}

if ( x == -1 ) {
x = 10;
}
showStatus("Moving " + direction);
repaint();
t.sleep( 100 ); // interval given in milliseconds
}
}
catch (Exception e) { }
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
*/
public void init()
{
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// provide any initialisation necessary for your JApplet

width = getSize().width;
height = getSize().height;
addKeyListener( this );
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
*/
public void start()
{
// provide any code requred to run each time
// web page is visited'
t = new Thread( this );
t.start();
}

/**
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
*/
public void stop()
{
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
}

/**
* Paint method for applet.
*
* @param g the Graphics object for this applet
*/
public void paint(Graphics g)
{
// simple text displayed on applet
g.setColor( Color.white );
g.fillRect( 0,0,width,height);
g.setColor( Color.blue );
g.fillRect( x * height / 10, y * height / 10, 50 , 50 );

}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
*/
public void destroy()
{
// provide code to be run when JApplet is about to be destroyed.
}


/**
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
*
* @return a String representation of information about this JApplet
*/
public String getAppletInfo()
{
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
}


/**
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
*
* @return a String[] representation of parameter information about this JApplet
*/
public String[][] getParameterInfo()
{
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
};
return paramInfo;
}
}
//




import java.awt.*;
import javax.swing.*;

/**
* Class Animate - write a description of the class here
*
* @author (your name)
* @version (a version number)
*/
public class Animate extends JApplet implements Runnable
{
// instance variables - replace the example below with your own
int width, height;
int y = 0;
Thread t = null;


public void run() {
//runs simultaneously with the applet's methods
try {
while (true) {
y++;
if ( y == 500 ) {
y = 0;
}

repaint();
t.sleep( 10 ); // interval given in milliseconds
}
}
catch (Exception e) { }
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
*/
public void init()
{
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// provide any initialisation necessary for your JApplet

width = getSize().width;
height = getSize().height;

}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
*/
public void start()
{
// provide any code requred to run each time
// web page is visited'
t = new Thread( this );
t.start();
}

/**
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
*/
public void stop()
{
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
}

/**
* Paint method for applet.
*
* @param g the Graphics object for this applet
*/
public void paint(Graphics g)
{
// simple text displayed on applet
g.setColor( Color.white );
g.fillRect( 0,0,width,height);
g.setColor( Color.blue );
g.fillRect( width/2, y, 50 , 50 );

}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
*/
public void destroy()
{
// provide code to be run when JApplet is about to be destroyed.
}


/**
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
*
* @return a String representation of information about this JApplet
*/
public String getAppletInfo()
{
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
}


/**
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
*
* @return a String[] representation of parameter information about this JApplet
*/
public String[][] getParameterInfo()
{
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
};
return paramInfo;
}
}

//
Read On 1 comments

Weekend Reminders!

Saturday, February 13, 2010
Sobrang tinatamad ako, kaya hindi 'to napost nung Friday.

At mas lalo akong tinatamad ngayon dahil fair kahapon.

At Valentine's Day ngayon.

Candy D.: str oral defense
Candy D.: bio reporting
Candy D.: fil original dla
Candy D.: physics long test
Candy D.: math hw
Candy D.: english long test
Candy D.: cs practest kasi hindi ka nagpractest.
Candy D.: socsci ow.

STR
- Oral Defense
- Mini-Research

Bio
- Reportings
- Plant Hormones Lab

Fil
- Original Dula

Physics
- LongTest

Math
- Pair HW (Hearts)

English
- LongTest on The Prophet

CS
- Practest sa mga hindi nagpractest.
- Mas mahirap yung inyo. @_@

Socsci
- Filler Signatures
- Slave Trade Notes
- Optional Work
Read On 2 comments

3 WEEKS TO GO!

Friday, February 05, 2010
Is that a bad or a good thing? :(

STR
- Fill up your log books and continue your researches.

Bio
- Jamon, Salcedo, Villacruel, Labalan, Tan! Report on the Vertebrate Endocrine System + Feedback Mechanisms (+, -) on Monday, February 8.
- Adre, Bautista, Cabanto, Ragudo, Villanueva, Bonifacio! Report on the Feedback Control In The Female Reproductive System on Tuesday, February 9
- SW Module for the Endocrine and Reproductive System.

Physics
- Long test on Thursday, February 11.

Chem
- Probset on Tuesday, February 9.

Math
- Achievement Test on Wednesday, February 10. 10:50 - 11:50

FAIR!
- Movies Booth!
- Updates on what to do and buy? :D

Ano pa? D:
Read On 1 comments

Color Spectrum

Thursday, February 04, 2010
I actually do not understand how the colors mix from red to yellow.

//


import java.awt.*;
import javax.swing.*;

/**
* Class spectrum - write a description of the class here
*
* @author (your name)
* @version (a version number)
*/
public class spectrum extends JApplet
{
// instance variables - replace the example below with your own
private int x;
int width, height;
int N = 25; // the number of colors created
Color[] spectrum; // an array of elements, each of type Color
Color[] spectrum2; // another array

/**
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
*/
public void init()
{
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// provide any initialisation necessary for your JApplet

width = getSize().width;
height = getSize().height;
setBackground( Color.black );

// Allocate the arrays; make them "N" elements long
spectrum = new Color[ N ];
spectrum2 = new Color[ N ];

// Generate the colors and store them in the arrays.
for ( int i = 1; i <= N; ++i ) {
// The three numbers passed to the Color() constructor
// are RGB components in the range [0,1].
// The casting to (float) is done so that the divisions will be
// done with floating point numbers, yielding fractional quotients.

// As i goes from 1 to N, this color goes from almost black to white.
spectrum[ i-1 ] = new Color( i/(float)N, i/(float)N, i/(float)N );

// As i goes from 1 to N, this color goes from almost pure blue to pure red.
spectrum2[ i-1 ] = new Color( i/(float)N, 0,(N-i)/(float)N );
}
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
*/
public void start()
{
// provide any code requred to run each time
// web page is visited
}

/**
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
*/
public void stop()
{
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
}

/**
* Paint method for applet.
*
* @param g the Graphics object for this applet
*/
public void paint( Graphics g ) {

int step = 90 / N;
for ( int i = 0; i < N; ++i ) {
g.setColor( spectrum[ i ] );
g.fillArc( 0, 0, 2*width, 2*height, 90+i*step, step+1 );

g.setColor( spectrum2[ i ] );
g.fillArc( width/3, height/3, 4*width/3, 4*height/3,
90+i*step, step+1 );
}
}

/**
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
*/
public void destroy()
{
// provide code to be run when JApplet is about to be destroyed.
}


/**
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
*
* @return a String representation of information about this JApplet
*/
public String getAppletInfo()
{
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
}


/**
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by
this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
*
* @return a String[] representation of parameter information
about this JApplet
*/
public String[][] getParameterInfo()
{
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
};
return paramInfo;
}
}




//
Read On 0 comments

Chem2

Recent Entries

Recent Comments