ComplexMapper

ComplexMapper preview image

1 collaborator

Default-person Joshua Abrams (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.1.0 • Viewed 175 times • Downloaded 17 times • Run 0 times
Download the 'ComplexMapper' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [selectedpt]

to startup
setup
end 

to setup
;; (for this model to work with NetLogo's new plotting features,
  ;; __clear-all-and-reset-ticks should be replaced with clear-all at
  ;; the beginning of your setup procedure and reset-ticks at the end
  ;; of the procedure.)
  __clear-all-and-reset-ticks
ask patches [set pcolor white]
crt 2 [set color black set heading who * 90 pd repeat 16 [fd 1 rt 90 fd .1 fd -.2 fd .1 lt 90] rt 180 fd 16 repeat 17 [rt 90 fd .1 fd -.2 fd .1 lt 90 fd 1]]
clear-turtles
crt 1 [set size 0]
end 

to add
ask turtles with [who != 0] [if KeepPre-image? [stamp] setxy xcor + real ycor + imaginary]
if ConnectPoints? [ask turtle 0 [pu move-to turtle 1 pd let index 1 repeat selectedpt - 1 [set index index + 1 move-to turtle (index)]]]
end 

to sub
ask turtles with [who != 0] [if KeepPre-image? [stamp] setxy xcor - real ycor - imaginary]
if ConnectPoints? [ask turtle 0 [pu move-to turtle 1 pd let index 1 repeat selectedpt - 1 [set index index + 1 move-to turtle (index)]]]
end 

to mult
ask turtles with [who != 0] [if KeepPre-image? [stamp] setxy xcor * real - ycor * imaginary xcor * imaginary + real * ycor]
if ConnectPoints? [ask turtle 0 [pu move-to turtle 1 pd let index 1 repeat selectedpt - 1 [set index index + 1 move-to turtle (index)]]]
end 

to div
ask turtles with [who != 0] [if KeepPre-image? [stamp] setxy (xcor * real + ycor * imaginary)/(real ^ 2 + imaginary ^ 2) (- xcor * imaginary + real * ycor) / (real ^ 2 + imaginary ^ 2)]
if ConnectPoints? [ask turtle 0 [pu move-to turtle 1 pd let index 1 repeat selectedpt - 1 [set index index + 1 move-to turtle (index)]]]
end 

to square
end 

to addpt
ask turtles [set shape "circle"]
crt 1 [set shape "square" set size 0.4 setxy real imaginary set selectedpt who]
if ConnectPoints? and (selectedpt != 1) [ask turtle 0 [pu move-to turtle (selectedpt - 1) pd move-to turtle (selectedpt)]]
end 

; to checkselect
; ask turtles with [who != selectedpt] [set shape "circle"]
; ask turtles with [who = selectedpt] [set shape "square"]
; end

There is only one version of this model, created about 8 years ago by Joshua Abrams.

Attached files

File Type Description Last updated
ComplexMapper.png preview Preview for 'ComplexMapper' about 8 years ago, by Joshua Abrams Download

This model does not have any ancestors.

This model does not have any descendants.