Buchempfehlung
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
"Der" Petzold, das über 1000 Seiten starke Standardwerk zum Win32-API - besonders nützlich u. a. bei der GUI-Programmierung in FreeBASIC! [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Noch'n Pythagoras

Uploader:Redakteurytwinky
Datum/Zeit:01.09.2007 23:56:45

#include "vbcompat.bi"

Function Runde(Variable As Double, nk As Integer) As Double
  Return cInt(Variable*10^nk)/10^nk
End Function

Const Rho=50/Atn(1)
Dim As Double a, b, c
Screen 18,32
Print "Dreiecksberechnung nach Pythagoras:"
Line(200, 200)-(504, 200)
Line(200, 200)-(400,  50)
Line(400,  50)-(504, 200)
Draw String (300, 100), "b"
Draw String (460, 110), "a"
Draw String (350, 210), "c"
Draw String (190, 200), "a"
Draw String (510, 200), "b"
Draw String (397,  30), "c"
Circle (397, 70), 1,,,,,F
Circle (400, 50), 40,, 240/Rho, 340/Rho
Input "Seite a:", a
Print
Input "Seite b:", b
Print
c=((a*a)+(b*b))^0.5

Print "Seite a=" &Format(Runde(a, 3), "#####.000")
Print "Seite b=" &Format(Runde(b, 3), "#####.000")
Print "Seite c=" &Format(Runde(c, 3), "#####.000")
Sleep