I've made some Code for you:
sync on
sync rate 60
backdrop on
color backdrop 0
a=45
b=45
r=100
for x=1 to 8
make object sphere x,2
next x
make object box 9,100,100,100
hide mouse
Camera_Zoom#=200
do
position mouse 320,240
if mouseclick()=1 then inc r
if mouseclick()=2 then dec r
if upkey()=1 then inc a
if downkey()=1 then dec a
If leftkey()=1 then dec b
if rightkey()=1 then inc b
REM **********************************************************************************************************************************
Q#=r*Cos(a)
L#=Q#*Sin(b)
D#=Q#*Cos(b)
H#=L#*Tan(a)
REM **********************************************************************************************************************************
Gosub Visuals
sync
Loop
Visuals:
set cursor 0,0
ink rgb(0,255,0),0
print "Length r = " + str$(r)
ink rgb(255,0,0),0
print "Angle a = " + str$(a) + " Length L# = " +str$(L#)
ink rgb(0,0,255),0
print "Angle b = " + str$(b) + " Length D# = " +str$(D#)
ink rgb(255,255,255),0
Print "Length H# = " +str$(H#)
ink rgb(128,0,255),0
Print "Length Q# = " +str$(Q#)
position object 1,0,0,0
position object 1,0 ,0 ,0
position object 2,L#,0 ,0
position object 3,0 ,H#,0
position object 4,0 ,0 ,D#
position object 5,L#,0 ,D#
position object 6,0 ,H#,D#
position object 7,L#,H#,0
position object 8,L#,H#,D#
Set camera to Follow L#/2,H#/2,D#/2,camy#,Camera_Height#,Camera_Distance#,1.5,0
point camera L#/2,H#/2,D#/2
camy#=camy#+mousemovex()
camx#=camx#+mousemovey()
Camera_Height#=Camera_Zoom#*-Sin(CamX#)
Camera_Distance#=Camera_Zoom#*Cos(CamX#)
if Camx#>170 then Camx#=170
if Camx#<10 then Camx#=10
DLine(0,0,0,L#,H#,0,255,0,0)
DLine(0,0,0,L#,0,0,255,0,0)
DLine(0,0,0,L#,0,D#,0,0,255)
DLine(0,0,0,0,0,D#,0,0,255)
DLine(0,H#,0,L#,H#,D#,128,0,255)
DLine(0,0,0,L#,H#,D#,0,255,0)
DLine(0,0,0,0,H#,0,255,255,255)
DLine(0,H#,0,0,H#,D#,128,128,128)
DLine(0,0,D#,0,H#,D#,128,128,128)
DLine(0,0,D#,L#,0,D#,128,128,128)
DLine(L#,0,0,L#,0,D#,128,128,128)
DLine(0,H#,0,L#,H#,0,128,128,128)
DLine(0,H#,D#,L#,H#,D#,128,128,128)
DLine(L#,H#,D#,L#,0,D#,128,128,128)
DLine(L#,H#,0,L#,0,0,128,128,128)
DLine(L#,H#,0,L#,H#,D#,128,128,128)
Dat(0,0,D#/2,0,0,255,"D#")
Dat(0,H#/2,0,255,255,255,"H#")
Dat(L#/2,0,0,255,0,0,"L#")
Dat(L#/2,H#,D#/2,128,0,255,"Q#")
Dat(L#/2,H#/2,D#/2,0,255,0,"r")
scale object 9,l#,h#,d#
position object 9,l#/2,h#/2,d#/2
Return
Function DLine(LineX1,LineY1,LineZ1,LineX2,LineY2,LineZ2,colourred,colourgreen,colourblue)
if object exist (100)=0 then Make object sphere 100,0.1
if object exist (200)=0 then Make object sphere 200,0.1
color object 100,rgb(colourred,colourgreen,colourblue)
color object 200,rgb(colourred,colourgreen,colourblue)
ink rgb(colourred,colourgreen,colourblue),0
position object 100,LineX1,LineY1,LineZ1
position object 200,LineX2,LineY2,LineZ2
if object in screen(100)+object in screen(200)=0
else
line object screen X(100),object screen Y(100),object screen X(200),object screen Y(200)
endif
endfunction
Function Dat(LineX1,LineY1,LineZ1,colourred,colourgreen,colourblue,stri$)
if object exist (101)=0 then Make object sphere 101,0.1
color object 101,rgb(colourred,colourgreen,colourblue)
ink rgb(colourred,colourgreen,colourblue),0
position object 101,LineX1,LineY1,LineZ1
if object in screen(101)=0
else
text object screen X(101),object screen Y(101),stri$
endif
endfunction
All the Trig is between the stared lines. Don't worry yourself about the visual code.
The angle
a represents the angle between the
red lines
the angle
b represents the angle between the
blue lines
r is the
diagonal length (Green Line)
Use
Up and Down arrow Keys to adjust
a
Use
left and right arrow keys to adjust
b
use
left and right mouse buttons to adjust
r
mouse move is rotate
L# is
Size of X
H# is
Size of Y
D# is
size of Z
Q# is the diagonal of the plane with Dimensions L# and D#
(Purple Line)
Hope this helps.
[EDIT]Updated the code to add a 3D box representation[/EDIT]