Ancestor of Coordinate, adding attribute charge

class PointCharge

==   =~   PointCharge.new   deep_copy   self.from_array   self.from_coordinate   to_point_charge   to_s  

Initialize

PointCharge.new(x = 0.0, y=0.0, z=0.0, charge = 0.0) # => PointCharge

self.from_array(array,c = 0.0)

self.from_coordinate(coordinate, c = 0.0)

Basics

deep_copy

Deep copy of the object

Type conversion

to_s

Conversion to String

to_point_charge

Allows conversion of descendants to PointCharge class

Comparison

== (point_charge) # true | false

=~ (point_charge) # true | false

Loose comparison, difference between each pair of coordinate elements must be smaller than class variable epsilon and the charge must match exactly.