9.05.2554

BME240 week9

p.20 

#include<stdio.h>
#include<conio.h>
float trapezoidarea(void)
{
      float length1,length2,high,area;
      printf("enter length1 : ");
      scanf("%f",&length1);
      printf("enter length2 : ");
      scanf("%f",&length2);
      printf("enter high : ");
      scanf("%f",&high);
      area = (length1+length2)*high/2;
      return(area);
}
main()
{
      float area;
      area = trapezoidarea();
      printf("Area is %.2f\n",area);
      getch();
}






p.23

#include<stdio.h>
#include<conio.h>
#include<math.h>
float mypow(float a)
{
      float result;
      result=a*a;
      return(result);
}
float mysqu(float a)
{
      float result;
      result=sqrt(a);
      return(result);
}
main()
{
      float a,b,result;
      while (1==1)
      {
      printf("enter number : ");
      scanf("%f",&a);
      printf("please select choice (1=power , 2=square root) : ");
      scanf("%f",&b);
      if (b=1)
      {
          result = mypow(a);
          printf("result = %.6f",result);
      }
      else if (b=2)
      {
           result = mysqu(a);
           printf("result = %.6f",result);
      }
      else
      {
          printf("menu error!!");
      }
      printf("\n***************\n");
      }
      getche();
}




p.27
#include<stdio.h>
#include<conio.h>
char cal_grade(float score);
main()
{
      float score;
      char grade; 
      printf("Enter score : ");
      scanf("%f",&score);
                         grade = cal_grade(score);
      printf("You get %c !!!",grade);
      getch();
}
char cal_grade(float score)
{
      char grade;
      if (score>=80)
      {
                 grade = 'A';
      }
      else if (score>=70&&score<80)
      {
                 grade = 'B';
      }
      else if (score>=60&&score<70)
      {
                 grade = 'C';
      }
      else if (score>=50&&score<60)
      {
                 grade = 'D';
      }
      else if (score<50)
      {
                 grade = 'F';
      }
      return(grade);
}



p.28
#include<stdio.h>
#include<conio.h>

float myaverage(void)
{
     float a,b,average;
     printf("Enter a : ");
     scanf("%f",&a);
     printf("Enter b : ");
     scanf("%f",&b);
                       average = (a+b)/2;
     return(average);
}
main()
{
      float average;
      average = myaverage();
      printf("Average is %.2f\n",average);
      getch();
}



ex.1
#include<stdio.h>
#include<conio.h>

int findmax(int n1,int n2);
main()
{
      int num1,num2,ans;
      printf("Enter number1 : ");
      scanf("%d",&num1);
      printf("Enter number2 : ");
      scanf("%d",&num2);
                        ans = findmax(num1,num2);
      printf("The max number is %d",ans);
      getch();
}
int findmax(int n1,int n2)
{
      int max;
          if (n1 > n2)
          {
                 max = n1;
          }
          else if (n2 > n1)
          {
                 max = n2;
          }
      return(max);
}


8.07.2554

Vocab from songs

Iridescent - Linkin Park
Do you feel cold n' lost your desperation
you build up hope , but failure's all you've know
remember all the sadness n' frustration n' let it go ,
desperation = the feeling that you have when you're in such a bad situation taht you're willing to take risks in order to change it = ความสิ้นหวัง ความผิดหวัง
ex. There was a note of desperation in his voice.
      In desperation , they jumped out of the window to escape the fire. 
      an act of desperation.
frustration = when you feel annoyed or less confident because you can't acheive what you want ; sth. that make you feel like this = ความไม่พอใจ
ex. I could sense his frustration at not being able to help.
      This job has more than its fair share of frustrations.

E.T. - Katy Pery
Kiss me , ki-ki-kiss me
infect me with your love n'
fill me with your poison
Take me , ta-ta-take me
wanna be your victim
ready for abduction

infect = to pass a disease to a person , animal or plant  =  ทำให้ติดโรค,ติดเชื้อ
ex. The ward was full of children infected with TB.
      All the tomato plants are infected with a virus.
abduction  = to force someone to go somewhere with you , often using treats or violence = การลักพาตัว
ex. The company director was abducted from his car by terrorists.
      He was charged with abduction.
      There has been a series of abduction of young children school in the area.



A whole new world - Alladin
I can show you the world
Shining , shimmering , splendid
tell me princess , now when did
you last let your hearth decide ?

shimmer = to shine in such a way that the lights seems to shake slightly and quickly
ex. She could see her reflection in the water , shimmering in the moonlight = ส่องแสงแวววาว
splendid  = excellent , or beautiful and impressive  = แจ่มจรัส
ex. We had splendid food/a splendid holiday/splendid weather.
      You look splendid in that outfit.



Skyscaper - Demi Lovato
As a smoke clears , I awaken
and untangle you from me
would it make you , feel better
to watch me while I bleed ?

awaken = to stop sleeping or to make someone stop slepping  = กระตุ้น,ทำให้ตื่นตัว
ex. They're awakened by the sound of gunfire.
      I awakened at dawn to find him beside me.
untangle = to remove the knots from an untidy mass of string , wire , etc. and seperate the different threads  =  คลายให้หายยุ่ง


Don't stop the party - Black eyed peas
This is that original
this has no identical
you can't have my digital,
future aboriginal ,
i stay on that pinnacle ,
chewin up my lyricals,
call me verbal criminal ,
subscribe use of chemical ,
i.d.o and visual , can't see me , invisible.

identical = exactly the same , or very similar = เหมือนกัน,แบบเดียวกัน
ex. I've got three identical blue suits.
      The two rooms were virtually identical.
      The test are identical to those carried out last year.
pinnacle = the most successful or admired part of a system or achievement = จุดสุดยอด,จุดสูงสุด
ex. By the edge of thirty-two she had reached the pinnacle of  her career.
lyrical = expressing personal thoughts and feeling in a beautiful way = โคลงสั้นๆ
ex. The book contains lyrical description of the author's childhood.



E.T. - Katy Perry feat. Kanye West


อ้างอิง http://www.siamzone.com
           http://dictionary.cambridge.org/
           http://club.myfri3nd.com/music-is-life/webboard/9852/47181

8.06.2554

How to use Stellarium , planetarium programe

โปรแกรมท้องฟ้าจำลอง Stellarium


     โปรแกรมท้องฟ้าจำลองเป็นโปรแกรมที่ใช้เป็นสื่อการสอนทางดาราศาสตร์ชนิดหนึ่งที่นำมาใช้ในการสอนวิชาดาราศาสตร์ได้เป็นอย่างดียิ่งชนิดหนึ่ง ซึ่งแต่เดิมหรือแม้แต่ในปัจจุบันก็อาจจะไม่เป็นที่รู้จักแพร่หลายเท่าไรนักในการเรียนการสอนดาราศาสตร์โปรแกรมที่มีชื่อเสียงและเป็นที่รู้จักกัน เช่น โปรแกรม Starry Night เป็นโปรแกรมท้องฟ้าจำลองที่อาจจะมีใช้อยู่บ้างในสถานศึกษาบางแห่ง และหน่วยงานที่ให้บริการด้านวิทยาศาสตร์ดาราศาสตร์ เช่น ศูนย์วิทยาศาสตร์เพื่อการศึกษา ซึ่งเป็นโปรแกรมที่มีลิขสิทธิ์ที่ต้องมีค่าใช้จ่ายในการซื้อหามาใช้ในราคาที่ค่อนข้างแพง โดยเฉพาะถ้าเป็นโปรแกรมรุ่นใหม่ๆที่มีระบบการใช้งานหรือรายละเอียดการควบคุมที่ซับซ้อนจะมีราคาตั้งแต่หลักหลายพันบาทจนถึงหลายหมื่นบาทเลยทีเดียว แต่สำหรับโปรแกรมที่จะนำมานำเสนอให้ได้รู้จักและแบ่งปันกันนำไปใช้กันนี้เป็นโปรแกรมท้องฟ้าจำลองที่แจกฟรีสำหรับนำไปใช้เพื่อการศึกษา มีชื่อเรียกว่า Stellarium ซึ่งมีลักษณะเป็นซอฟต์แวร์ท้องฟ้าจำลองแบบ 3 มิติ แสดงภาพท้องฟ้าเหมือนจริง สามารถสภาพของท้องฟ้า ดวงดาว และยังเลือกแสดงเส้นกลุ่มดาว รูปภาพกลุ่มดาว ชื่อของดวงดาวต่างๆ ชื่อกลุ่มดาวที่เป็นกลุ่มดาวสากล รวมถึงจำลองการเคลื่อนที่ของทรงกลมท้องฟ้า และยังเลือกเวลาและสถานที่ที่ใช้ในการสังเกตได้ เหมาะอย่างยิ่งสำหรับการใช้สอนดูดาวประกอบท้องฟ้าจริง หรือใช้สอนประกอบการใช้แผนที่ดาว ถ้าท่านที่สนใจอยากทราบรายละเอียดเพิ่มเติมก็สามารถเข้าไปศึกษาเพิ่มเติมได้ที่เว็บไซต์อย่างเป็นทางการของโปรแกรมนี้ ที่ http://www.stellarium.org


แถบเครื่องมือต่างๆและวิธีการใช้งานเบื้องต้น


ตารางแสดงแถบเครื่องมือใน main tool bar
     บางปุ่มใช้สำหรับการเลือกเปิด-ปิดลักษณะบางประการเพื่อความเหมาะสมต่อการนำเสนอหรือความเหมือนจริงของซอฟต์แวร์  บางปุ่มใช้เปิดหน้าต่าง (Windows) เพื่อตั้งหรือกำหนดค่าต่าง ๆ   การเปิด-ปิดปุ่มสามารถทำได้ 2 วิธี คือ ใช้เมาส์คลิกที่ปุ่มแถบเครื่องมือ หรือกดแป้นอักขระบนคีย์บอร์ดเป็นแถบเครื่องมือที่อยู่ทางด้านซ้ายของภาพในจอภาพ


ลักษณะ
ปุ่มแถบเครื่องมือ
แป้นอักขร
รายละเอียด
กลุ่มดาว

C
วาดเส้นเชื่อมระหว่างดาว ช่วยให้เห็นเป็นกลุ่มดาว
ชื่อกลุ่มดาว

V
เปิด-ปิดป้ายชื่อกลุ่มดาว
ภาพกลุ่มดาว

R
เปิด-ปิดการซ้อนภาพสัญลักษณ์ในกลุ่มดาว
กริดแอซิมัท

Z
เปิด-ปิดเส้นกริดในระบบพิกัด Alt/Azi
กริดศูนย์สูตร

E
เปิด-ปิดเส้นกริดในระบบพิกัด RA/Dec
พื้นดิน

G
เปิด-ปิดภาพพื้นดินให้ทะลุเห็นดาวใต้พื้นดิน
จุดทิศหลัก

Q
เปิด-ปิดให้เห็นเครื่องหมายจุดทิศหลัก
บรรยากาศ

A
เปิด-ปิดให้สามารถมองเห็นดาวได้ในเวลากลางวัน
เนบิวลาและกาแล็กซี

N
เปิด-ปิดเครื่องหมายแสดงตำเหน่งเนบิวลาและกาแล็กซี  เมื่อฟีลด์การมองเห็นกว้างเกินไป
ชื่อดาวเคราะห์

P
เปิด-ปิดชื่อดาวเคราะห์
ระบบพิกัด

Ctrl+M
เปิดสลับกันระหว่าง Alt/Azi และ RA/Dec
ไปดูที่

Space
เลื่อนและตรึงวัตถุท้องฟ้าที่เลือกไว้ให้อยู่ตรงกลางจอภาพ
โหมดกลางคืน

-
เปิด-ปิดการแสดงภาพด้วยแสงสีแดง
เปิดโปรแกรมเต็มจอ

F11
เปิดโปรแกรมแบบ full-screen
มุมมองแบบกลม

Ctrl+O
ปรับมุมมองเป็นการมองรอบวัตถุเป็นวงกลม
วงโคจรของดาวเทียม

Ctrl+Z
เปิด-ปิดเส้นวงโคจรของดาวเทียม
ออกจากโปรแกรม

Ctrl+q
ปิดโปรแกรมสเตลลาเรียม

ตารางแสดงแถบเครื่องมือใน time control bar
     เป็นแถบเครื่องมือที่อยู่ด้านขวาของภาพในจอภาพ  ซึ่งประกอบด้วยปุ่มปรับจำนวน 4 ปุ่ม ใช้สำหรับการเปลี่ยนทิศทางหรือปรับอัตราการเคลื่อนของเวลา  เมื่อเริ่มเปิดซอฟต์แวร์สเตลลาเรียม โปรแกรมจะกำหนดวันและเวลาตามค่าของระบบ  การแสดงการเคลื่อนที่ของวัตถุท้องฟ้าจะสัมพันธ์กับการเคลื่อนของเวลาในระบบ  อย่างไรก็ตาม สามารถปรับให้เวลาเคลื่อนไปข้างหน้า (เดินหน้า) หรือเคลื่อนถอยหลังได้    นอกจากนี้ ยังสามารถปรับความเร็วได้อีกด้วย  


ลักษณะ
ปุ่มแถบเครื่องมือ
แป้นอักขระ
รายละเอียด
เวลาถอยหลัง

J
ปรับเวลาให้เคลื่อนถอยหลัง   เลือกซ้ำความเร็วเพิ่มขึ้น
ความเร็วปกติ

K
ปรับเวลาให้เคลื่อนไปด้วยความเร็วปกติ
เวลาเดินหน้า

L
ปรับเวลาให้เคลื่อนไปข้างหน้า  เลือกซ้ำความเร็วเพิ่มขึ้น
กลับสู่เวลาปัจจุบัน

8
เลือกกลับมาสู่เวลาและวันที่ที่เป็นปัจจุบัน
     
     สำหรับการกำหนดตำแหน่งสังเกตเราสามารถตั้งตำแหน่งสังเกตได้จากปุ่มบนแถบเครื่องมือ Location window  ซึ่งทำได้โดยการใช้เมาส์เลือกตำแหน่งสังเกตในแผนที่โดยตรงหรือการใช้เมาส์เลื่อนปุ่มควบคุม โดยเราจะต้องทราบตำแหน่งลองจิจูดและละติจูดของจุดสังเกตด้วย และเมื่อกำหนดค่าได้ตามต้องการแล้วให้บันทึกค่าโดยทำการตั้งชื่อของจุดสังเกตและเลือกเลือก add to list เพื่อทำการบันทึกจุดสังเกตนั้นๆ

     การกำหนดวันที่และเวลาที่เราจะทำการสังเกตนั้นสามารถปรับค่าได้จากปุ่มบนเครื่่องมือ Date / time window โดยปกติแล้วซอต์ฟแวร์นี้จะใช้เวลาปัจจุบันและเขตเวลาจากคอมพิวเตอร์ ซึ่งการตั้งวันและเวลาจะมีผลต่อตำแหน่้งของดวงดาว

     ในการเลือกภูมิทัศน์ซอต์ฟแวร์นี้ได้มีการกำหนดภูมิทัศน์ให้เลือกถึง 6  แบบประกอบด้วย Garching , Guereins , Hurricane , Moon , Ocean และ Trees ซึ่งสามารถเลือกได้ในแถบเครืองมือดังรูป นอกจากนี้ในแถบเครื่องมือ sky and viewing option window นี้ยังสามารถปรับและตั้งค่าการกำหนดโหมดภาพหรือวิธีการฉายภาพในท้องฟ้า ซึ่งการฉายภาพแต่ละแบบมีความแตกต่างกันควรเลือกใช้ให้เหมาะสม และ เราสามารถกำหนดค่าการแสดงเส้นลองจิจูด ละติจูด เส้นศูนย์สูตร ฯลฯ รวมไปถึงการแสดงตำแหน่งรูปร่างของดาวตามตำนานของแต่ละภูมิภาคของโลกได้อีกด้วย 

     ในการค้นหาตำแหน่งของดวงดาวต่างๆถ้าเราทราบชื่อของดาวดวงนั้นๆเราสามารถค้นหาได้ทันทีจากแถบเครืื่องมือ Search window โดยทำการพิมพ์ชื่อของดวงดาวที่ต้องการค้นหา

   และในการกำหนดภาษาและการตั้งค่าเบื้องต้นต่างๆของโปรแกรมสารถปรับค่าได้ที่แถบเครื่องมือ Configuration window เมื่อทำการปรับค่าเสร็จแล้วสามารถบันทึกค่าได้โดยคำสั่ง save setting 

     แถบเครื่องมือสุดท้าย Help window จะเป็นการรวบรุมและสรุปปุ่มลัดต่างๆบนคีย์บอร์ดเพื่อให้ง่ายแก่การใมช้งานของผู้ศึกษาและจะมีรายละเอียดของโปรแกรมประกอบอยูด้วย


Screenshot








demo - how to use Stellarium





อ้างอิง : http://astronscience.blogspot.com/2008/12/blog-post_06.html
              http://sourceforge.net
              http://google.co.th