1. Tuyển Mod quản lý diễn đàn. Các thành viên xem chi tiết tại đây

Co' ai iu thi'ch vat ly' khong ne` ???

Chủ đề trong 'Đề thi - Đáp án' bởi paingod, 03/08/2001.

  1. 1 người đang xem box này (Thành viên: 0, Khách: 1)
  1. paingod

    paingod Thành viên rất tích cực

    Tham gia ngày:
    23/07/2001
    Bài viết:
    3.274
    Đã được thích:
    0
    ã các wed site về vật lý
    http://www.alcyone/max từ điển vật lý
    http://www.library.com/advanced/org/10796
    Cung cấp các bài ging về lý thuyết vật lý,các bài tập c bn trong phổ thông
    http://www.aip.org Các bài ging về nghiên cứu,các bài toán thực hành,các con số thực nghiệm
    http://abacus.bates.edu/-jburke/open1/physics.html các định luật chuẩn
    http://www.howthingswork.edu Một sự tổng hợp của kiến thức phổ thông lẫn kiến thức đại học
    http://umbra.gsfc.nasa.gov
    http://spaceart.com/solar
    http://www.xraysite.com một giao diện rất dễ dàng cho bạn tìm kiếm nhanh chóng ngoài ra bạn còn có thể download các phần mềm vật lý

    Chỳc t?t lnh
    Paingod@
  2. platalise

    platalise Thành viên mới

    Tham gia ngày:
    28/08/2001
    Bài viết:
    8
    Đã được thích:
    0
    dây là chuong trình v? du?ng s?c di?n tru?ng trên Java
    d? v? du?c v?i nhi?u di?n tích b?n thay d?i thông s? n và thêm vào các thông s? trong hàm initialisation
    class Point{
    int x,y;
    static int N = Eline.taille;

    Point(int a, int b){
    x = a;
    y = b;
    }

    public static double distance(Point p1, Point p2){
    return Math.sqrt((p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y));
    }

    public static boolean est_dans_boite(Point p) {
    return (p.x > 2) && (p.x <= N-2) && (p.y > 2) && (p.y <= N-2);
    }
    }
    class Eline {

    final static int n = 2; // Le nombre de charges;
    final static int taille = 500;
    final static double k1 = 0.16108;
    final static double k2 = 0.43935;
    final static double k3 = 0.63400;

    static int palette[] = {MacLib.whiteColor, MacLib.redColor,
    MacLib.blueColor, MacLib.greenColor,
    MacLib.yellowColor, MacLib.magentaColor,
    MacLib.cyanColor, MacLib.blackColor};

    static Point pe[] = new Point[n];
    static byte charge [] = new byte [n] ;

    static void initialisation(){
    pe[0] = new Point(300,250);charge[0] = 5;
    pe[1] = new Point(150,250);charge[1] = -10;
    //pe[2] = new Point(170,220);charge[2] = -15;
    //pe[3] = new Point(350,160);charge[3] = 5;

    }
    static boolean ne_touche_pas(Point p){
    boolean a = true;
    for (int i = 0; i < n; ++i)
    if (Math.abs(p.x - pe.x) < 2 && Math.abs(p.y - pe.y) < 2)
    {
    a = false;
    break;
    }
    return a;
    }

    static double angle(Point p){
    double s1,s2 ;
    s1 = 0; s2 = 0;
    for (int i = 0; i < n; ++i){
    s1 = s1 + charge*(p.y - pe.y)/Math.pow(Point.distance(p,pe),3);
    s2 = s2 + charge*(p.x - pe.x)/Math.pow(Point.distance(p,pe),3);
    }
    double s = Math.sqrt(s1*s1 + s2*s2);
    if (s == 0) return 1000;
    else {
    s1 = s1/s; s2 = s2/s;

    if (s1 >= 0) return Math.acos(s2);
    else return 2*Math.PI - Math.acos(s2);
    }
    }

    static boolean est_null(Point p){
    return (angle(p) == 1000);
    }

    static Point chercher(Point p, byte signe){
    byte dx = 0; byte dy = 0;
    double s = Math.sin(angle(p));
    double c = Math.cos(angle(p));

    if (s >= -1 && s < -k3) dy = -3;
    else if (s >= -k3 && s < -k2) dy = -2;
    else if (s >= -k2 && s < -k1) dy = -1;
    else if (s >= -k1 && s < k1) dy = 0;
    else if (s >= k1 && s < k2) dy = 1;
    else if (s >= k2 && s < k3) dy = 2;
    else dy = 3;

    if (c >= -1 && c < -k3) dx = -3;
    else if (c >= -k3 && c < -k2) dx = -2;
    else if (c >= -k2 && c < -k1) dx = -1;
    else if (c >= -k1 && c < k1) dx = 0;
    else if (c >= k1 && c < k2) dx = 1;
    else if (c >= k2 && c < k3) dx = 2;
    else dx = 3;
    if (signe > 0)
    if (est_null(new Point(p.x + dx, p.y + dy)))
    return new Point(p.x + 2*dx, p.y + 2*dy);
    else return new Point(p.x + dx, p.y + dy);
    else if (est_null(new Point(p.x - dx, p.y - dy)))
    return new Point(p.x - 2*dx, p.y - 2*dy);
    else return new Point(p.x - dx, p.y - dy);
    }

    static void trajectoire (Point p, byte signe){
    Point p1 = new Point(p.x,p.y);
    MacLib.moveTo (p1.x,p1.y);

    while (Point.est_dans_boite(p1) && ne_touche_pas(p1)){
    MacLib.lineTo(p1.x,p1.y);
    p1 = chercher(p1,signe);
    }
    }

    static void dessiner (Point p, byte signe){
    MacLib.foreColor(palette[5]);
    trajectoire(new Point(p.x + 3,p.y),signe);
    trajectoire(new Point(p.x + 3,p.y + 3),signe);
    trajectoire(new Point(p.x,p.y + 3),signe);
    trajectoire(new Point(p.x - 3,p.y + 3),signe);
    trajectoire(new Point(p.x - 3,p.y),signe);
    trajectoire(new Point(p.x - 3,p.y - 3),signe);
    trajectoire(new Point(p.x ,p.y - 3),signe);
    trajectoire(new Point(p.x + 3,p.y - 3),signe);
    }

    public static void main(String [] args) {

    initialisation();

    MacLib.initQuickDraw();
    MacLib.SetDrawingRect( new Rect( 100, 100, 100 + taille, 100 + taille ) );
    MacLib.foreColor(palette[5]);

    for (int i = 0; i < n; ++i){
    dessiner(pe,charge);
    }

    for (int i = 0; i < n; ++i){
    Rect r = new Rect();
    int t = Math.round((float)(Math.sqrt(10*Math.abs(charge))));
    MacLib.setRect(r,pe.x- t,pe.y- t,pe.x + t,pe.y + t);
    if (charge > 0) MacLib.foreColor(palette[1]);
    else MacLib.foreColor(palette[2]);
    MacLib.paintOval(r);
    }
    }
    }

Chia sẻ trang này