38 members
60 members
14 members
16 members
8 members
Replied 1 day ago
Kalakian has not received any gifts yet
Loading feed
Posted on October 10, 2009 at 7:54pm —
Posted on October 11, 2008 at 2:30pm — 5 Comments
Started by Daniel Livingstone in News. Last reply by Kalakian 1 day ago.
Started by John Sutherland in Teaching & Learning @UWS. Last reply by Daniel Livingstone Nov 27.
Started by Daniel Livingstone in Tech Chat Nov 27.
Started by Jossy Barron in News. Last reply by Ross Drew Nov 27.
Started by John Sutherland in Just for fun. Last reply by Peter Bloomfield Nov 25.
Started by Kenny Singer in Just for fun Nov 25.
Started by Stevo aka Dr Katata Fish in Just for fun. Last reply by Stewart Barnes Nov 25.
Started by Kalakian in Teaching & Learning @UWS. Last reply by Kalakian Nov 25.
Started by Stevo aka Dr Katata Fish in News. Last reply by Prof. Dr. SatNAV MSc CGT DDR FF7 Nov 24.
Started by John Sutherland in Teaching & Learning @UWS Nov 24.
Started by Daniel Livingstone in Portfolios & Employment. Last reply by Stewart Barnes Nov 24.
Started by Peter Murdoch in Projects. Last reply by Ross Kilgariff Nov 24.
Started by Scott Roberts in News. Last reply by Gary Hogg Nov 21.
Started by Brandon Morris in Just for fun. Last reply by Brandon Morris Nov 20.
Started by Kieran Nelson in Just for fun. Last reply by Seán Hamilton Nov 19.
Started by McGrevey in Teaching & Learning @UWS. Last reply by Gary Hogg Nov 19.
Started by Daniel Livingstone in Teaching & Learning @UWS. Last reply by Brandon Morris Nov 18.
Started by Stevo aka Dr Katata Fish in Teaching & Learning @UWS Nov 17.
Started by Sean Winston in Uncategorized. Last reply by Giovanni Masucci Nov 16.
Started by Buck_Fast in Just for fun. Last reply by Michael "Bez" Berryman Nov 15.
© 2009 Created by John Sutherland on Ning. Create Your Own Social Network
Comment Wall (48 comments)
You need to be a member of WoSGamers to add comments!
Join this social network
I've checked my last message, but the code has come out all wrong. Don't worry about it anyway - I'll keep battling on with vectors in my own time. I'll get there eventually!
I'm generally making progress on the Python book, but there is one "listing" which isn't working. I'm trying to produce a vector, whereby I am plotting an object stopping ten times going from Position A to Position B. This is the code:
#!/usr/bin/env python
import math
class Vector2(object):
def __init__(self, x=0.0, y=0.0):
self.x = x
self.y = y
def __str__(self):
return "(%s, %s)"%(self.x, self.y)
@staticmethod
def from_points(P1, P2):
return Vector2( P2[0] - P1[0], P2[1] - P1[1] )
def __mul__(self, scalar):
return Vector2(self.x * scalar, self.y * scalar)
A = (10.0, 20.0)
B = (30.0, 35.0)
AB = Vector2.from_points(A, B)
step = AB * 0.1
position = Vector2(A.x, A.y)
for n in range(10):
position += step
print position
For some reason this isn't working, despite it being in the book. I was wondering if you had some cunning ideas on fixing this problem?
Thanks, Malcolm
View All Comments