Public Member Functions | Private Attributes | Static Private Attributes | List of all members
wirecell.util.wires.generator.Point Class Reference
Inheritance diagram for wirecell.util.wires.generator.Point:

Public Member Functions

def __init__ (self, coords)
 
def __str__ (self)
 
def __repr__ (self)
 
def x (self)
 
def x (self, val)
 
def y (self)
 
def y (self, val)
 
def __len__ (self)
 
def __getitem__ (self, key)
 
def __setitem__ (self, key, val)
 
def __iter__ (self)
 
def __abs__ (self)
 
def __sub__ (self, other)
 
def __add__ (self, other)
 
def __mul__ (self, other)
 
def __div__ (self, other)
 
def dot (self, other)
 
def magnitude (self)
 
def unit (self)
 

Private Attributes

 _coords
 

Static Private Attributes

 __truediv__ = __div__
 

Detailed Description

Definition at line 15 of file generator.py.

Constructor & Destructor Documentation

def wirecell.util.wires.generator.Point.__init__ (   self,
  coords 
)

Definition at line 16 of file generator.py.

16  def __init__(self, *coords):
17  self._coords = list(coords)
18 

Member Function Documentation

def wirecell.util.wires.generator.Point.__abs__ (   self)

Definition at line 49 of file generator.py.

49  def __abs__(self):
50  return Point(*[abs(a) for a in self])
51 
T abs(T value)
def wirecell.util.wires.generator.Point.__add__ (   self,
  other 
)

Definition at line 58 of file generator.py.

58  def __add__(self, other):
59  try:
60  return Point(*[(a+b) for a,b in zip(self, other)])
61  except TypeError:
62  return Point(*[(a+other) for a in self])
63 
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:295
def wirecell.util.wires.generator.Point.__div__ (   self,
  other 
)

Definition at line 70 of file generator.py.

70  def __div__(self, other):
71  try:
72  return Point(*[(a/b) for a,b in zip(self, other)])
73  except TypeError:
74  return Point(*[(a/other) for a in self])
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:295
def wirecell.util.wires.generator.Point.__getitem__ (   self,
  key 
)

Definition at line 42 of file generator.py.

42  def __getitem__(self, key):
43  return self._coords[key]
def wirecell.util.wires.generator.Point.__iter__ (   self)

Definition at line 46 of file generator.py.

46  def __iter__(self):
47  return self._coords.__iter__()
48 
def wirecell.util.wires.generator.Point.__len__ (   self)

Definition at line 40 of file generator.py.

def wirecell.util.wires.generator.Point.__mul__ (   self,
  other 
)

Definition at line 64 of file generator.py.

64  def __mul__(self, other):
65  try:
66  return Point(*[(a*b) for a,b in zip(self, other)])
67  except TypeError:
68  return Point(*[(a*other) for a in self])
69 
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:295
def wirecell.util.wires.generator.Point.__repr__ (   self)

Definition at line 23 of file generator.py.

23  def __repr__(self):
24  return str(self)
25 
static QCString str
def wirecell.util.wires.generator.Point.__setitem__ (   self,
  key,
  val 
)

Definition at line 44 of file generator.py.

44  def __setitem__(self, key, val):
45  self._coords[key] = val
def __setitem__(self, key, val)
Definition: generator.py:44
def wirecell.util.wires.generator.Point.__str__ (   self)

Definition at line 19 of file generator.py.

19  def __str__(self):
20  s = ",".join([str(a) for a in self._coords])
21  return "Point(%s)" % s
22 
static QCString str
def wirecell.util.wires.generator.Point.__sub__ (   self,
  other 
)

Definition at line 52 of file generator.py.

52  def __sub__(self, other):
53  try:
54  return Point(*[(a-b) for a,b in zip(self, other)])
55  except TypeError:
56  return Point(*[(a-other) for a in self])
57 
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:295
def wirecell.util.wires.generator.Point.dot (   self,
  other 
)

Definition at line 77 of file generator.py.

77  def dot(self, other):
78  return sum([a*b for a,b in zip(self, other)])
79 
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:295
def wirecell.util.wires.generator.Point.magnitude (   self)

Definition at line 81 of file generator.py.

81  def magnitude(self):
82  return math.sqrt(self.dot(self))
83 
def wirecell.util.wires.generator.Point.unit (   self)

Definition at line 85 of file generator.py.

85  def unit(self):
86  mag = self.magnitude
87  return self/mag
88 
def wirecell.util.wires.generator.Point.x (   self)

Definition at line 27 of file generator.py.

27  def x(self):
28  return self[0]
def wirecell.util.wires.generator.Point.x (   self,
  val 
)

Definition at line 30 of file generator.py.

30  def x(self, val):
31  self[0] = val
32 
def wirecell.util.wires.generator.Point.y (   self)

Definition at line 34 of file generator.py.

34  def y(self):
35  return self[1]
def wirecell.util.wires.generator.Point.y (   self,
  val 
)

Definition at line 37 of file generator.py.

37  def y(self, val):
38  self[1] = val
39 

Member Data Documentation

wirecell.util.wires.generator.Point.__truediv__ = __div__
staticprivate

Definition at line 75 of file generator.py.

wirecell.util.wires.generator.Point._coords
private

Definition at line 17 of file generator.py.


The documentation for this class was generated from the following file: