vendredi 25 octobre 2024

2D pinball physic's engine

 




//flipper

class flipper {

float R,r,D,phi0;

float phi,omega;

float deltaphi=PI/2.6;

float choc=1.2;

float Vpinball = 25;

vec2 v,vt;

vec2 o,m;

vec2 a1,b1,a2,b2;

wall w1,w2 ;

circle c1,c2;

 //bar() { };

 

 flipper(vec2 io,float iR,float ir,float iD,float iphi0) {

   o = new vec2(io.x,io.y); 

   R =iR; r = ir; D = iD; phi0 = iphi0;

   m = new vec2(D,0);

 // rotate the bar  

   m = add(o,m);

   m = rot(m,o,phi0);

 // compute the two walls

  float L = sqrt(D*D-pow(R-r,2));

  a1 = new vec2();

  b1 = new vec2();

  a1.x = R*(R-r)/D+o.x; a1.y = R*L/D+o.y;

  b1.x = r*(R-r)/D+D+o.x; b1.y = r*L/D+o.y;

  a1 = rot(a1,o,phi0); b1 = rot(b1,o,phi0);

  w1 = new wall(a1.x,a1.y,b1.x,b1.y);

  a2 = new vec2();

  b2 = new vec2();

  a2.x = R*(R-r)/D+o.x; a2.y = -R*L/D+o.y;

  b2.x = r*(R-r)/D+D+o.x; b2.y = -r*L/D+o.y;

  a2 = rot(a2,o,phi0); b2 = rot(b2,o,phi0);

  w2 = new wall(a2.x,a2.y,b2.x,b2.y); 

  c1 = new circle(o.x,o.y,R);c1.choc =0.5;

  c2 = new circle(m.x,m.y,r);c2.choc =0.5;

   v =new vec2(0,0);

   vt =new vec2(0,0);

   omega = 5;

 }


void draw() {

  strokeWeight(1);

  stroke(0,255,0);

 fill(255,0,0,100);

 beginShape();

vertex(w1.a.x,w1.a.y);

vertex(w1.b.x,w1.b.y);

vertex(w2.b.x,w2.b.y);

vertex(w2.a.x,w2.a.y);

endShape(CLOSE);

  noFill();

  w1.wg=2; w2.wg = 2;

  w1.setcolor(255,0,0);

  w2.setcolor(255,0,0);

 w1.draw();w2.draw();

  //stroke(255,0,0);

  strokeWeight(1);

  fill(255,0,0);

  ellipse(o.x,o.y,2*R,2*R);

  ellipse(m.x,m.y,2*r,2*r);

 fill(255);  stroke(255);  strokeWeight(2);

  ellipse(o.x,o.y,R,R);

  ellipse(m.x,m.y,r,r);

}


void  update_motion(float t) {

    a1 = rot(a1,o,omega*t);

    b1 = rot(b1,o,omega*t);

    w1.a.x =a1.x;w1.a.y =a1.y;w1.b.x =b1.x;w1.b.y=b1.y;

    w1.omega = omega;

    a2 = rot(a2,o,omega*t);

    b2 = rot(b2,o,omega*t);

    w2.a.x =a2.x;w2.a.y =a2.y;w2.b.x =b2.x;w2.b.y=b2.y;

    w2.omega = omega;

    m = rot(m,o,omega*t);

    c2.p.x = m.x;c2.p.y=m.y;

    phi+=omega*t;

  }

  boolean touch_left() {

    for ( int i=0;i< touches.length;i++) 

    if (touches[i].x>width/2) return true;

    return false;

  }

   boolean touch_right() {

    for ( int i=0;i< touches.length;i++) 

    if (touches[i].x<width/2) return true;

    return false;

  }

   void control_right( char c) {

   if (/*touchIsStarted*/touch_left() ) {

   // if (!sound_pinball.isPlaying()) sound_pinball.play();


    if (phi>=phi0+deltaphi) omega=0; else omega=Vpinball;

  } else {

    if (phi<=phi0) omega=0; else omega=-Vpinball;

   }}

  

   void control_left( char c) {

      if (/*touchIsStarted*/ touch_right()) {

     //   sound_pinball.stop();

     // if (!sound_pinball.isPlaying()2) sound_pinball.play();


      

    if (phi<=(phi0-deltaphi)) omega=0; else omega=-Vpinball;

  } else {

    if (phi>=phi0) omega=0; else omega=Vpinball;

  }

   }

boolean collision(ball b) {

    

    

    return w1.collision(b) || w2.collision(b) || c1.collision(b) || c2.collision(b);

}


}

vendredi 10 février 2023

the power of Trigonometric functions!












اليوم اقدم برنامج يبين ما مدى اهمية الدوال الجيبية في محاكات حركة دوران عقرب الساعة مكتوب بلغة جافا , عدد اسطره لا يتجاوز 40 كما هو موضح ا


/* CLOCK */

PImage clock;
float rh,rm,rs;
float xh,yh,thetah;
float xm,ym,thetam;
float xs,ys,thetas;
void setup() {
size(600,600);
clock=loadImage("e:/processing/clock0.jpg");
rh = 80; rm = 120; rs = 160;
}
void draw() {
thetah = 2*PI*hour()/12-PI/2;
xh = rh* cos(thetah)+width/2; yh = rh* sin(thetah)+height/2;
thetam = 2*PI*minute()/(60)-PI/2;
xm = rm* cos(thetam)+width/2; ym = rm* sin(thetam)+height/2;
thetas = 2*PI*second()/(60)-PI/2;
xs = rs* cos(thetas)+width/2; ys = rs* sin(thetas)+height/2;
background(0);
image(clock,0,0);
textSize(20);
fill(0);
textAlign(CENTER);
text(hour()+":"+minute()+":"+second(),width/2,180);
stroke(0,0,255); strokeWeight(3);
line(width/2,height/2,xs,ys);
stroke(0,255,0); strokeWeight(5);
line(width/2,height/2,xm,ym);
stroke(255,0,0); strokeWeight(8);
line(width/2,height/2,xh,yh);
}

dimanche 27 novembre 2022

لعبة hockeyball بواسطة الشبكة !


















هذه اللعبة ستكون اول نموذج تعليمي بحيث سأقوم توضيح جميع الخطوات برمجة الالعاب من النقطة صفر الى مستوى الاعتراف , الدروس ستكون على شكل اجزاء متسلسلة , اشير في الاخير ان هذه الدروس موجهة لمن لديهم ادنى معرف عن البرمجة نظريا و الرياضيات مستوى ثانوي على الاقل
1/ اختيار لغة البرمجة المناسبة
2/ علاقة شاشة الكمبيوتر بالهندسة ثنائية الابعاد
3/ مفهوم الرسومات و تحويلها الى تعليمات رقمية
4/ مبدأ حركة الرسومات في الشاشة
5/ تفاعل الفأرة و لوحة المفاتيح مع الكمبيوتر
7/ فيزياء الحركة و اصطدام الرسومات
8/ ادارة الاحداث و توجيهها
9/ مبدأ الذكاء الاصطناعي و تطبيقاته في الالعاب
10/ برمجة العاب عن طريق شبكة LAN


 

mercredi 2 novembre 2022

double pendulum

 





float theta1,vtheta1,theta2,vtheta2;

float x1,y1,x2,y2;
float vx,vy;
float g=9.8;
float l= 4;
void init() {
theta1 =0; vtheta1 = 0.0;
theta2 =0; vtheta2 = 0.0;
//l= density*l;
}
void motion(float dt) {
float a= 2;
float b= cos(theta1-theta2);
float c= cos(theta1-theta2);
float d = 1;
float b1= vtheta1*vtheta2*sin(theta1-theta2)-2*g/l*sin(theta1)+ax*vx;
float b2 = -vtheta1*vtheta2*sin(theta1-theta2)-g/l*sin(theta2)+ay*vy;
float det = a*d-b*c;
float r1= (d*b1-b*b2)/det;
float r2= (-c*b1+a*b2)/det;
vtheta1+= dt*r1;
vtheta2+= dt*r2;
// vtheta1+= dt/l*(ax*cos(theta1)+sin(theta1)*(-g+ay));
// vphi+=dt/(l*sin(phi))*(ax*sin(phi)-ay*cos(phi));
theta1+= vtheta1*dt;
vtheta1*=0.98;
// vtheta2+= vtheta1+dt/l*(ax*cos(theta2)+sin(theta2)*(-g+ay));
theta2+= vtheta2*dt;
vtheta2*=0.98;
vx+=dt*ax;
vy+=dt*ay;
}
void pendulum() {
strokeWeight(10);
k=100;
float theta1,vtheta1,theta2,vtheta2;
float x1,y1,x2,y2;
float vx,vy;
float g=9.8;
float l= 4;
void init() {
theta1 =0; vtheta1 = 0.0;
theta2 =0; vtheta2 = 0.0;
//l= density*l;
}
void motion(float dt) {
float a= 2;
float b= cos(theta1-theta2);
float c= cos(theta1-theta2);
float d = 1;
float b1= vtheta1*vtheta2*sin(theta1-theta2)-2*g/l*sin(theta1)+ax*vx;
float b2 = -vtheta1*vtheta2*sin(theta1-theta2)-g/l*sin(theta2)+ay*vy;
float det = a*d-b*c;
float r1= (d*b1-b*b2)/det;
float r2= (-c*b1+a*b2)/det;
vtheta1+= dt*r1;
vtheta2+= dt*r2;
// vtheta1+= dt/l*(ax*cos(theta1)+sin(theta1)*(-g+ay));
// vphi+=dt/(l*sin(phi))*(ax*sin(phi)-ay*cos(phi));
theta1+= vtheta1*dt;
vtheta1*=0.98;
// vtheta2+= vtheta1+dt/l*(ax*cos(theta2)+sin(theta2)*(-g+ay));
theta2+= vtheta2*dt;
vtheta2*=0.98;
vx+=dt*ax;
vy+=dt*ay;
}
void pendulum() {
strokeWeight(10);
k=100;
x1=k*l*sin(theta1)+x0;
y1=k*l*cos(theta1)+y0;
x2=x1+k*l*sin(theta2);
y2=y1+k*l*cos(theta2);
stroke(255);
float k=1000;
stroke(255);
line(x0,y0,x1,y1);
line(x1,y1,x2,y2);
stroke(255,0,0);fill(255,255,0);
// ellipse(x1,y1,60,60);
fill(200,0,0);noStroke();
lights();
//ambientLight(0,0,0,0,-1,0);
lightSpecular(255,255,255);
directionalLight(200,100,100,-1,0,-1);
specular(200);
pushMatrix();
translate(x1,y1);
sphere(50);
popMatrix();
pushMatrix();
translate(x2,y2);
sphere(60);
popMatrix();
noFill();stroke(200);
ellipse(x0,y0,60,60);
ellipse(x0,y0,10,10);
}

Hologram


 

mardi 7 juin 2022

fastdraw64 tuto 7 clipping "fd_view"

 



#include "fastdraw.cpp"

image t800;

float  zoom = 0;

bool s = true;


void draw() {

zoom+=0.03;

float kx = 0.6*cos(zoom*0.05);

kx = kx*kx;

float ky = 3.14/3*cos(zoom*0.3);

     fd_clear(0,0,100);

  

     fd_view(200,100,700,600);

fd_image(t800,100*kx,100*ky);

 fd_view(100,250,900,600);

fd_image(t800,0,0,150,100);

fd_view(100,150,900,600);

fd_image(t800,120,80,250,250);

 fd_view(100,300,900,400);

fd_image(t800,120+350,80,450,300);

fd_view(300,200,400,700);

fd_image(t800,50,350,900,600);


fd_view(0,00,900,600);

        fd_image(t800,t800.bmWidth/2,t800.bmHeight/2,ky,kx,kx,100,200);

}


int main() {

t800 = fd_loadimage("c:/dos/t800.bmp");

       fd_window("fd64 tuto6 ",1000,800);

        fd_loop(draw);

return 0;

}



lundi 30 mai 2022

Camera Security using smartphone as camera ...written in processing

Laptop






SmartPhone



اقدم اليوم تطبيق من برامجي الخاصة CameraSecurity يقوم بمراقبة و تسجيل الفيديو عن بعد بواسطة شبكة الويفي و كل هذا لا يكلف درهما واحد سوى جهاز كمبيوتر pc او laptop و هاتف نقال خاص يعمل بدلا من كاميرا مراقبة ثمنها باهض حيث يمكنكم ان تضعوا هاتفكم في اي مكان و زاوية لبث مباشر على شاشة الفيديو في جهازكم الكمبيوتر من مكتبكم او اي مكان اخر

mercredi 18 mai 2022

fastdraw64 tuto6 rotate & scale

 



#include "fastdraw.cpp"

BITMAP t800;

float  zoom = 0;

bool s = true;

void draw() {

zoom=zoom+0.03;

float kx = sin(zoom*0.05);

kx = kx*kx;

float ky = 3.14/3*cos(zoom*0.3);

      fd_clear(0,0,100);

            fd_image(t800,t800.bmWidth/2,t800.bmHeight/2,ky,kx,kx,100,200);

 



}


int main() {

t800 = fd_loadimage("c:/dos/t800.bmp");

        fd_window("fd64 tuto4 ",1000,800);

       fd_loop(draw);

return 0;

}

lundi 16 mai 2022

fastdraw64 tuto 5 special effect ....

 



#include "fastdraw64.cpp"


BITMAP t800;

float  time= 0;

void draw() {

time+=0.1;

     fd_clear(0,0,100);

                for (int ys=0;ys<t800.bmHeight;ys++) 

                        fd_hline_bitmap(100+20*sin(0.04*ys-0.5*time),200+ys,t800,ys);


}


int main() {

t800 = fd_loadimage("c:/dos/t800.bmp");

       fd_window("fd64 tuto5  special effects.. ",1000,800);

       fd_loop(draw);


return 0;

}



dimanche 15 mai 2022

fastdraw64 tuto 4 scale image

 




#include "fastdraw.cpp"


BITMAP t800;


void draw() {

                   fd_clear(0,0,100);

        fd_image(t800,0,0,150,100);

fd_image(t800,120,80,250,250);

fd_image(t800,120+350,80,450,300);

fd_image(t800,50,350,900,600);

}


int main() {

t800 = fd_loadimage("c:/dos/t800.bmp");

    fd_window("fd64 tuto4 ",1000,800);

    fd_loop(draw);

return 0;

}



jeudi 12 mai 2022

fastdraw64 tuto3 view image 330 FPS



 


#include "fastdraw.cpp"

BITMAP t800;


void draw() {

      fd_clear(0,0,100);
   
fd_image(t800,mouseX-t800.bmWidth/2,mouseY-t800.bmHeight/2);
  
}



int main() {

    t800 = fd_loadimage("c:/dos/t800.bmp");

    fd_window("fd64 tuto3",1000,600);

    fd_loop(draw);

return 0;
}




mardi 10 mai 2022

fastdraw64 tuto2 ellipse

 




// fd64 tuto 2 

#include "fastdraw.cpp"

void draw() {

     fd_clear(0,0,100); // clear screen

      fd_ellipse(mouseX,mouseY,80,80,rgb(255,0,0)); // drawing ellipse using mouse coordinates

}


int main() {

    fd_window("fd64 tuto2",800,600);  // create fastdraw window

    fd_loop(draw);  // call draw function

return 0;

}



FastDraw64 tuto 1 create window

  fastdraw64 is a graphic engine software rendering running on 64 bits windows platform  written in C and assembly language





// fastdraw64 tuto1  create window

#include "fastdraw.cpp"

void draw() {

     fd_clear(0,0,100);  // clear the buffer 

 }

int main() {

    fd_window("fd64 tuto1",800,600);

    fd_loop(draw);

return 0;

}


Fast Clear 64bits


void   fd_clear(byte r,byte g,byte b) {

static byte red asm("red") = r;
        static byte green asm("green") = g;
static byte blue asm("blue") = b;
asm ("mov rax,red\n"
         "shl rax,8\n"
         "or  rax,green\n"
         "shl rax,8\n"
         "or  rax,blue\n"
         "mov rbx,rax\n"
         "shl rax,32\n"
                 "or  rax,rbx\n"
         "mov  rdi,fd_backbuffer\n"
         "mov rcx,size\n"
          "shr rcx,3\n"
          "cld\n"
          "rep stosq");

}




mercredi 1 décembre 2021

physic's car engine demo version 0.3 programmed on my smartphone!


 





خورزميات محاكات حركة السيارة
الجزء الثاني : القسم التطبيقي
هذه الفيديو  هي عبارة عن هيكل لسيارة تبرز  اهمية المعدلات التفاضلي  لحساب مسار الدواليب االمرسومة بالخطوط الحمراء كما تلاحضون و التحكم على التسارع و اتجهاه المقود عن كريق الضغط على الزر
ملاحضة : هذا البرنامج مكتوب بلغة الجافا على هاتفي النقال و تم تطوير في اوقات الفراغ في المقهى.
void motion(float dt) {
  
     v+=a*dt;
     v*=0.995;
     
     phiA+=v/RA*dt;
     phiB+= v/(RB*abs(cos(wtheta)))*dt;
     omega = v*tan(wtheta)/D;
     phi+= omega*dt;
   
      AB.x=abx*cos(phi)-aby*sin(phi); 
      AB.y=abx*sin(phi)+aby*cos(phi);
    
     
      float stepa= v/D*dt;
      float stepb= omega*dt;
     
      AR.x+=stepa*AB.x;
      AR.y+=stepa*AB.y;
     
      AL.x+=stepa*AB.x;
      AL.y+=stepa*AB.y;
      
      BR.x+= stepa*AB.x-stepb*AB.y;
      BR.y+= stepa*AB.y+stepb*AB.x;
      
      BL.x+= stepa*AB.x-stepb*AB.y;
      BL.y+= stepa*AB.y+stepb*AB.x;
     
     rot(AL,(AL.x+AR.x)/2,(AL.y+AR.y)/2,omega*dt);
     rot(AR,(AL.x+AR.x)/2,(AL.y+AR.y)/2,omega*dt);
     rot(BL,(BL.x+BR.x)/2,(BL.y+BR.y)/2,omega*dt);
     rot(BR,(BL.x+BR.x)/2,(BL.y+BR.y)/2,omega*dt);
     
      G.x=(AL.x+AR.x+BL.x+BR.x)/4;
      G.y=(AL.y+AR.y+BL.y+BR.y)/4;
     
      al.add(new PVector(AL.x,AL.y,0));
      ar.add(new PVector(AR.x,AR.y,0));
      br.add(new PVector(BR.x,BR.y,0));
      bl.add(new PVector(BL.x,BL.y,0));
   
   float fx= v*v/D*tan(wtheta);
   float fz= 10;
   alpha = 0.05*atan(fx/fz);
   }

dimanche 14 novembre 2021

خوارزميات محاكات مسار حركة السيارة

 

الجزء الاول  القسم النظري

ملاحضة : هذه المقالة موجة لاصحاب الاختصاص في البرمجة المحاكات و الالعاب و لديهم مستوى عالي في الرياضيات 

A الدولاب الخلفي

B الدولاب الامامي

|AB|=L  مسافة بين دواليب الامامية و الخلفية

 Va  سرعة دواليب الخلفية

Vb= V سرعة دواليب الامامية

θ  زاوية دوان الدواليب المامية و اتجاه سرعة السيارة

الهدف من هذه المسألة هو حساب مسار الدواليب الاربعة للسيارة مع تغير سرعة و اتجاه السيارة و من ثم ايجاد الخوارزميات المناسب للتحكم في سياقة السيارة مع المتغيرات الاساسية السرعة و زاوية دوران دواليب الامامية

كما نلاحض في الصورة ان المسافة بين الدولاب الامامي و الخلفي يبق دائما ثابتة و السرعة تساوي   V| = |Vb| cos(θ)| => 

 |Vb|= |V|/cos(θ)  

و بتالي شعاع Vb مركب من شعاعين اثنية على مسقاط المماس و الخط القائم 

Vb = Vb cos(θ) Tab +  Vb sin(θ) Nab

Tab = AB/|AB|

Nab شعاع قائم بنسبة ل AB

OA=(xa,ya) OB=(xb,yb)

AB=(xab,yab)=OB-OA=(xb-xa,yb-ya)

xab=xb-xa

yab=yb-ya

Tab= AB/|AB|  =  AB/L= (xab/L,yab/L)

Nab _|_  Tab  =>  Nab . Tab = 0

Nab=(-yab,xab)

Vb = Vb cos(θ) Tab +  Vb sin(θ) Nab

=>

Vb = V/cos(θ) * cos(θ) Tab +  V/cos(θ)* sin(θ) Nab

Va = V Tab

Vb = V Tab +  V tan(θ) Nab

dAB/dt= dOB/dt- dOA/dt= Vb-Va= V tan(θ) Nab

dAB/dt=V  tan(θ) Nab


dTab/dt=V tan(θ)/L Nab
Zab(t) = Zab(0) exp( i ∫ V(t) tan(θ(t))/L dt)
A(t)= ∫ V(t) Tab dt
dB(t)/dt =∫ V(t) Tab dt +∫ V(t) tan(θ(t)) Nab dt
K = tan(θ) /L

هذه هي معادلة الشعاعية التفاظلية لحركة النسبية للدواليب  A و B

dxab(t)/dt  = -V tan(θ)/L yab(t)

dyab(t)/dt  = V tan(θ)/L xab(t)

ω=V tan(θ)/L  سرعة دوران السيارة

dxab(t)/dt  = - ω yab(t)  (1)

dyab(t)/dt  = ω xab(t)    (2)

نقوم الان باضافة الاعداد المركبة لتبسيط المعادلة

Zab = xab + i yab

(1)+ i (2) =>

 dxab(t)/dt  + i dyab(t)/dt= - ω yab(t) +i ω xab(t) 

 d(xab(t) + i yab(t))/dt= i ω ( i yab(t) + xab(t) )

dZab/dt = iω Zab

ln Zab = ∫ iω dt + Constant

Zab(t) = Zab(0) exp( i  ∫ ω(t) dt)

Zab(t) = Zab(0) exp( i  ∫ V(t) tan(θ(t))/L dt) 

و بما ان السرعة الدواليب الخلفية و زاوية الدوران الدواليب الامامية متغيرة سيتولى الحاسوب حل هذه المعادلة التفاظلية بطريقة euler

 الجميع من يقود السيارة يعلم ان اذا قمنا بتثبيت السرعة و المقود ستقوم السيارة بالدوران على نفسها و ترسم شكل دائري او  حركة مستقيم اذا كان المقود مستقيم

لنقم بحساب نصف قطر  الدائرة الخارجية و الداخلية لمسار  سيارة في حالة θ # 0

θ(t) = θ ثابة

V(t) = V ثابة

Zab(t) = Zab(0) exp( i  ∫ V tan(θ)/L dt) 

Zab(t) = Zab(0) exp( i V tan(θ)/L t) 

xab(0)=L    yab(0)=0

Zab(0) =xab(0)+ i yab(0) = L

 Zab(t) = L exp( i V tan(θ)/L t) 

xab(t)= L cos( V tan(θ)/L t) 

yab(t)= L sin( V tan(θ)/L t) 

xb(t)= xab(t)+ xa(t)

yb(t)= yab(t)+ ya(t)

dOA/dt = V Tab

dxa(t)/dt= V/L xab(t)   dya(t)/dt= V/L yab(t)

dxa(t)/dt= V cos( V tan(θ)/L t) 

dya(t)/dt= V sin( V tan(θ)/L t) 

xa(t)=  ∫ V cos( V tan(θ)/L t) dt

ya(t)=  ∫ V sin( V tan(θ)/L t)  dt

xa(t)=  L cot(θ) sin( V tan(θ)/L t) +C1

ya(t)=  -L cot(θ) cos( V tan(θ)/L t) +C2

xa(0)= 0   ya(0)= 0

xa(t)=  L cot(θ) sin( V tan(θ)/L t) 

ya(t)=  L cot(θ) (1-cos( V tan(θ)/L t) )

xa(t)² + (ya(t)- L cot(θ))²=   L² cot(θ)²

Ra =  L cot(θ)

xa^2 + (ya-R)^2=  R^2

نستنتج ان حركة الدولاب A  الخلفي هو على شكل معادلة الدائرة  نصف قطرها   |L |cot(θ)

Ra =  L |cot(θ)|

xb(t)= xab(t)+ xa(t)

yb(t)= yab(t)+ ya(t)

 xb(t)= L cos( V tan(θ)/L t) + L cot(θ) sin( V tan(θ)/L t) 

yb(t)=L sin( V tan(θ)/L t)  + L cot(θ) (1-cos( V tan(θ)/L t) )

xb(t)= L/sin(θ) sin( V tan(θ)/L t +θ) 

yb(t)=-L/sin(θ) cos( V tan(θ)/L t +θ) +L cot(θ)

xb(t)²+ (yb(t)- L cot(θ))²=   L²/sin(θ)²

Rb =  L/|sin(θ)|

 Ra = Rb |cos(θ)|

Ra/Rb= |cos(θ)|

و نستنتج ايضا  ان حركة الدولاب B المامي هو يخضع لمعادلة الدائرة  نصف قطرها  |(L/|sin(θ

تابع الجزء الثاني

تطبيق المعدلات النظرية في البرنامج و تجسيدها على شكل خوزميات...

jeudi 28 octobre 2021

hydrogen electron orbitals in 3d space

 
 
 

بيان ثلاثي الابعاد لمدارات الالكترون في ذرة الهيدروجين وفقًا لتوزيع شرودنجر لاحتمال كثافة الوجود في مكان ما ! تم
إنشاؤه بواسطة برنامجي shader GPU


Visualizing the hydrogen electron orbitals in 3d space according the Schrodinger distribution of the probability of presence ! generated by shader GPU code ....

ih dψ(r,t)/dt=(-h²/2m ( d²ψ(r,t)/dx²+d²ψ(r,t)/dy²+d²ψ(r,t)/dz²)-Ze²/r ψ(r,t))
ρ(r,θ,φ) = |ψ(r,t)|²