On Mon, 12 Nov 2012 00:31:53 +, Oscar Benjamin wrote:
[...]
>>> You were right the first time, Chris. A point that happens to coincide
>>> with the arbitrarily chosen origin is no more truthy or falsey than
>>> any other. A vector of length 0 on the other hand is a very different
>>> beast.
>>
On 12 November 2012 01:29, Mark Lawrence wrote:
> On 12/11/2012 01:18, Oscar Benjamin wrote:
>>
>> On 12 November 2012 01:10, Mark Lawrence wrote:
>>>
>>> On 12/11/2012 00:31, Oscar Benjamin wrote:
Plain wrong. Vectors are not defined *from any origin*.
>>>
>>> So when the Captain says
In article ,
Oscar Benjamin wrote:
> But then I'm assuming you meant that 245 degrees was a bearing
> relative to North. Was it supposed to be relative to my current angle?
> Truthfully I wouldn't know what to do without asking the captain a
> couple more questions.
Granted, this requires some
On 12/11/2012 01:15, Roy Smith wrote:
In article ,
Mark Lawrence wrote:
On 12/11/2012 00:31, Oscar Benjamin wrote:
Plain wrong. Vectors are not defined *from any origin*.
So when the Captain says "full speed ahead, steer 245 degrees", you
haven't the faintest idea where you're going, be
On 12/11/2012 01:18, Oscar Benjamin wrote:
On 12 November 2012 01:10, Mark Lawrence wrote:
On 12/11/2012 00:31, Oscar Benjamin wrote:
Plain wrong. Vectors are not defined *from any origin*.
So when the Captain says "full speed ahead, steer 245 degrees", you haven't
the faintest idea where
In article ,
Mark Lawrence wrote:
> On 12/11/2012 00:31, Oscar Benjamin wrote:
> >
> > Plain wrong. Vectors are not defined *from any origin*.
> >
>
> So when the Captain says "full speed ahead, steer 245 degrees", you
> haven't the faintest idea where you're going, because you have no origin?
On 12 November 2012 01:10, Mark Lawrence wrote:
> On 12/11/2012 00:31, Oscar Benjamin wrote:
>>
>>
>> Plain wrong. Vectors are not defined *from any origin*.
>>
>
> So when the Captain says "full speed ahead, steer 245 degrees", you haven't
> the faintest idea where you're going, because you have
On 12/11/2012 00:31, Oscar Benjamin wrote:
Plain wrong. Vectors are not defined *from any origin*.
So when the Captain says "full speed ahead, steer 245 degrees", you
haven't the faintest idea where you're going, because you have no origin?
--
Cheers.
Mark Lawrence.
--
http://mail.python
On Nov 11, 4:31 pm, Oscar Benjamin wrote:
> On 11 November 2012 22:31, Steven D'Aprano
> > Nonsense. The length and direction of a vector is relative to the origin.
> > If the origin is arbitrary, as you claim, then so is the length of the
> > vector.
>
> Wrong on all counts. Neither the length n
On Nov 10, 11:33 am, Jennie wrote:
> What is the best solution to solve the following problem in Python 3.3?
>
> import math
> >>> class Point:
> ... def __init__(self, x=0, y=0):
> ... self.x = x
> ... self.y = y
> ... def __sub__(self, other):
> ... return Point(
On 11 November 2012 22:31, Steven D'Aprano
wrote:
> On Sun, 11 Nov 2012 14:21:19 +, Oscar Benjamin wrote:
>
>> On 11 November 2012 02:47, Chris Angelico wrote:
>>> On Sun, Nov 11, 2012 at 1:43 PM, Ian Kelly
>>> wrote:
On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico
wrote:
> I
On Sun, 11 Nov 2012 14:21:19 +, Oscar Benjamin wrote:
> On 11 November 2012 02:47, Chris Angelico wrote:
>> On Sun, Nov 11, 2012 at 1:43 PM, Ian Kelly
>> wrote:
>>> On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico
>>> wrote:
I would not assume that. The origin is a point, just like any
On 11 November 2012 02:47, Chris Angelico wrote:
> On Sun, Nov 11, 2012 at 1:43 PM, Ian Kelly wrote:
>> On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico wrote:
>>> I would not assume that. The origin is a point, just like any other.
>>> With a Line class, you could deem a zero-length line to be l
On Sat, Nov 10, 2012 at 11:43 PM, Ian Kelly wrote:
> Where I wrote "(0,0) is the origin" above I was not referring to a
> point, not a tuple, but I can see how that was confusing.
What I meant to say is I *was* referring to a point. Gah!
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Nov 10, 2012 at 7:53 PM, Roy Smith wrote:
> In article ,
> Ian Kelly wrote:
>
>> On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico wrote:
>> > I would not assume that. The origin is a point, just like any other.
>> > With a Line class, you could deem a zero-length line to be like a
>> > z
In article ,
Ian Kelly wrote:
> On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico wrote:
> > I would not assume that. The origin is a point, just like any other.
> > With a Line class, you could deem a zero-length line to be like a
> > zero-element list, but Point(0,0) is more like the tuple (0,0
On Sun, Nov 11, 2012 at 1:43 PM, Ian Kelly wrote:
> On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico wrote:
>> I would not assume that. The origin is a point, just like any other.
>> With a Line class, you could deem a zero-length line to be like a
>> zero-element list, but Point(0,0) is more like
On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico wrote:
> I would not assume that. The origin is a point, just like any other.
> With a Line class, you could deem a zero-length line to be like a
> zero-element list, but Point(0,0) is more like the tuple (0,0) which
> is definitely True.
It's more
On Sun, Nov 11, 2012 at 12:13 PM, Steven D'Aprano
wrote:
> Almost but not quite. I assume that, in a full Point class, you would
> want Point(0, 0) to count as false in a boolean context. (A "falsey"
> value, like None, [], 0.0, etc.)
I would not assume that. The origin is a point, just like any
On 10 November 2012 19:33, Jennie wrote:
> What is the best solution to solve the following problem in Python 3.3?
>
> import math
class Point:
> ... def __init__(self, x=0, y=0):
> ... self.x = x
> ... self.y = y
> ... def __sub__(self, other):
> ... return Po
On Sat, 10 Nov 2012 20:33:05 +0100, Jennie wrote:
[...]
> I propose three solutions. The first one:
>
> >>> class Point:
> ... def __init__(self, x=0, y=0):
> ... self.x = x
> ... self.y = y
> ... def __sub__(self, other):
> ... return Point(self.x - other.x, self
On 11/10/2012 03:51 PM, Jennie wrote:
> On 11/10/2012 09:29 PM, Terry Reedy wrote:
>
>> On 11/10/2012 2:33 PM, Jennie wrote:
>>>
>>> I propose three solutions. The first one:
>>>
>>> >>> class Point:
>>> ... def __init__(self, x=0, y=0):
>>> ... self.x = x
>>> ... self.y = y
>>
On 11/10/2012 09:29 PM, Terry Reedy wrote:
On 11/10/2012 2:33 PM, Jennie wrote:
I propose three solutions. The first one:
>>> class Point:
... def __init__(self, x=0, y=0):
... self.x = x
... self.y = y
... def __sub__(self, other):
... return Point(self.x - o
On 11/10/2012 2:33 PM, Jennie wrote:
What is the best solution to solve the following problem in Python 3.3?
import math
>>> class Point:
... def __init__(self, x=0, y=0):
... self.x = x
... self.y = y
... def __sub__(self, other):
... return Point(self.x - other
On Sun, Nov 11, 2012 at 6:33 AM, Jennie wrote:
> ... def distance(self, point=None):
> ... p = point if point else Point()
I'd go with this one. Definitely not the third one, which mutates the
class according to a current global every time a Point is instantiated
- could be *extremely
25 matches
Mail list logo