PicoCalc - Circle

PicoMite BASIC

Caculates Minecraft positions X, Y, Z for a building a tilted circle

Inputs:

  • center X, Y, Z
  • radius
  • tilt horizontal (degrees)
  • tilt horizontal (degree)
  • tilt vertical (degrees)
  • number of points
  • Accounts for Minecraft using the Y axis for height.

    We're using it to build giant orbital rings as part of a solar system

    
    pi=3.1415926535
    Option angle degrees
    CLS
    Input "center x";cx
    Input "center y";cy
    Input "center z";cz
    Input "radius";r
    Input "horz tilt";tv
    Input "vert tilt";th
    Input "num points";np
    
    For i=0 To np-1
      angle=360*i/np
    
      x=r*Cos(angle)
      z=r*Sin(angle)
      y=0
    
      ny=y*Cos(tv)-z*Sin(tv)
      nz=y*Sin(tv)+z*Cos(tv)
      y=ny
      z=nz
    
      nx=x*Cos(th)-z*Sin(th)
      nz=-x*Sin(th)+z*Cos(th)
      x=nx
      z=nz
    
      x=x+cx
      y=y+cy
      z=z+cz
    
      x=Cint(x)
      y=Cint(y)
      z=Cint(z)
    
      Print "pt ";i+1": (";x;",";y;",";z;")"
    
      If i Mod 24=0 And i>0 Then
      Input "Press Enter to continue...",k
      EndIf
    
    Next i