File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -788,6 +788,63 @@ return $this.Step(
788
788
)
789
789
</Script >
790
790
</ScriptMethod >
791
+ <ScriptMethod >
792
+ <Name >HatMonotile</Name >
793
+ <Script >
794
+ < #
795
+ .SYNOPSIS
796
+ Draws a hat aperiodic monotile.
797
+ .DESCRIPTION
798
+ This function uses turtle graphics to draw an aperiodic monotile called a "Hat"
799
+ .EXAMPLE
800
+ turtle rotate -90 hatMonotile 100 save ./hatMonotile.svg
801
+ .LINK
802
+ https://github.com/christianp/aperiodic-monotile/blob/main/hat-monotile.logo
803
+ #>
804
+ param(
805
+ [double]
806
+ $A = 100,
807
+
808
+ [double]
809
+ $B = 0
810
+ )
811
+
812
+ if (-not $B) {
813
+ $B = [Math]::Tan(60 * [Math]::PI / 180) * $A
814
+ }
815
+
816
+
817
+ return $this.
818
+ Forward($b).
819
+ Rotate(90).
820
+ Forward($a).
821
+ Left(60).
822
+ Forward($a).
823
+ Rotate(90).
824
+ Forward($b).
825
+ Rotate(60).
826
+ Forward($b).
827
+ Left(90).
828
+ Forward($a).
829
+ Rotate(60).
830
+ Forward($a).
831
+ Rotate(90).
832
+ Forward($b).
833
+ Rotate(60).
834
+ Forward($b).
835
+ Left(90).
836
+ Forward($a).
837
+ Rotate(60).
838
+ Forward($a).
839
+ Forward($a).
840
+ Rotate(60).
841
+ Forward($a).
842
+ Rotate(90).
843
+ Forward($b).
844
+ Left(60)
845
+
846
+ </Script >
847
+ </ScriptMethod >
791
848
<ScriptMethod >
792
849
<Name >HilbertCurve</Name >
793
850
<Script >
You can’t perform that action at this time.
0 commit comments