Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Vector/Processing-Python-mode/vector.processing-py
Normal file
17
Task/Vector/Processing-Python-mode/vector.processing-py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
v1 = PVector(5, 7)
|
||||
v2 = PVector(2, 3)
|
||||
|
||||
println('{} {} {} {}\n'.format( v1.x, v1.y, v1.mag(), v1.heading()))
|
||||
|
||||
# math overloaded operators (static methods in the comments)
|
||||
println(v1 + v2) # PVector.add(v1, v2)
|
||||
println(v1 - v2) # PVector.sub(v1, v2)
|
||||
println(v1 * 11) # PVector.mult(v1, 11)
|
||||
println(v1 / 2) # PVector.div(v1, 2)
|
||||
println('')
|
||||
|
||||
# object methods (related augmented assigment in the comments)
|
||||
println(v1.sub(v1)) # v1 -= v1; println(v1)
|
||||
println(v1.add(v2)) # v1 += v2; println(v2)
|
||||
println(v1.mult(10)) # v1 *= 10; println(v1)
|
||||
println(v1.div(10)) # v1 /= 10; println(v1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue