B4J Tutorial Modular Multiplication on a Circle

B4J Project attached. No other libs other than the default B4J libs required (can probably be easily converted to B4A and B4I as it only draws on a standard B4J canvas)

The code is simple and the principle used to do this is also simple - but it creates complex and beautiful patterns. Run the project, sit back, and enjoy the beauty of Modular Multiplication on a Circle for a number of minutes (put on some nice classical music in the background and relax while watching the patterns being drawn). Some amazing patterns (about 99 of them) being drawn in real time - the only change from one pattern to the next is an increase of the multiplier by +1.

Change the code to your liking.

1706111212891.png
1706111133292.png
1706111359863.png
 

Attachments

  • b4jMathModularCircle.zip
    2.3 KB · Views: 59
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Try this one - add your own function to the code:

B4X:
public Sub mathf(x As Float) As Float
    
    Return x * c
    'Return x + (x Mod 3) * 49.9 + 49.9 + c     ' was x * c multiplication function
    'Return (x Mod c)
    'Return x + 40 + c
    'Return x + c + divisions/2
    'Return Sin(x * c) * 100
    'Return Power(x, 2) + c
    
End Sub

No other libs required other than the default B4J libs.

Real time animation....

1706353879963.png
 

Attachments

  • b4jMathModularCircleNew.zip
    2.3 KB · Views: 30
Top