I'M reading the book "Beginning Game Development with Python and Pygame". The book showed me how to calculate the distance between two points using vectors. It first explained that you just subtract the values in the first point from the second. But just page or two pages later it says that in order to calculate the distance I need to get the square root of x squared + y squared. math.sqrt(self.x**2 + self.y**2)
The book seem to be describing the same thing in two completely different ways. Could someone please clarify this for me? Thanks.
lewashby 56 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.