تبلیغات
حرفای نگفته ی من - 20اذر
 

20اذر

نوشته شده توسط :سولیست سولی
شنبه 9 بهمن 1389-07:00 ب.ظ

P1x = 50

P1y = 50

P2x = 100

P2y = 50

P3x = 75

P3y = 75

DrawTriangle()

Tx = 0

Ty = 0

For move = 1 To 100

Tx = move

Ty = 0

GraphicsWindow.Clear()

MoveTriangle()

Program.Delay(100)

EndFor

 

'=================================================

'================ DRAW TRIABGLE ==================

'=================================================

Sub DrawTriangle

'------------------------- Khat 1

x1 = P1x

y1 = P1y

x2 = P2x

y2 = P2y

DDA()

'------------------------- Khat 2

x1 = P2x

y1 = P2y

x2 = P3x

y2 = P3y

DDA()

'------------------------- Khat 3

x1 = P1x

y1 = P1y

x2 = P3x

y2 = P3y

DDA()

EndSub

'=================================================

'================ MOVE TRIANGLE ==================

'=================================================

Sub MoveTriangle

'------------------------- Khat 1

x1 = P1x + Tx

y1 = P1y + Ty

x2 = P2x + Tx

y2 = P2y + Ty

DDA()

'------------------------- Khat 2

x1 = P2x + Tx

y1 = P2y + Ty

x2 = P3x + Tx

y2 = P3y + Ty

DDA()

'------------------------- Khat 3

x1 = P1x + Tx

y1 = P1y + Ty

x2 = P3x + Tx

y2 = P3y + Ty

DDA()

EndSub

'=================================================

'================ DRAW LINE ==================

'=================================================

Sub DDA

dx = x2 - x1

dy = y2 - y1

If Math.Abs(dx) > Math.Abs(dy) Then

steps = Math.Abs(dx)

Else

steps = Math.Abs(dy)

EndIf

xinc = dx / steps

yinc = dy / steps

x = x1

y = y1

GraphicsWindow.SetPixel(Math.Round(x), Math.Round(y), "Blue")

For i = 0 To steps

x = x + xinc

y = y + yinc

GraphicsWindow.SetPixel(Math.Round(x), Math.Round(y), "Blue")

EndFor

EndSub

 





نظرات() 


Why is my Achilles tendon burning?
سه شنبه 28 شهریور 1396 01:29 ق.ظ
Hi there are using Wordpress for your blog platform?
I'm new to the blog world but I'm trying to get
started and set up my own. Do you need any html coding expertise to make
your own blog? Any help would be really appreciated!
What causes the heels of your feet to burn?
سه شنبه 17 مرداد 1396 12:42 ب.ظ
I always emailed this weblog post page to all my contacts, as if like to read it after that my
friends will too.
How do you treat Achilles tendonitis?
شنبه 14 مرداد 1396 11:20 ق.ظ
My relatives every time say that I am killing my time here at
web, but I know I am getting experience daily by reading thes nice articles or reviews.
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر


درباره وبلاگ:



آرشیو:


طبقه بندی:


آخرین پستها:


پیوندها:


نویسندگان:


ابر برچسبها:


آمار وبلاگ:







The Theme Being Used Is MihanBlog Created By ThemeBox