x
and z
geometry :: Point :: defaultinit
geometry $ Point :: core_serialize_to
Actual serialization ofself
to serializer
geometry $ Point :: from_deserializer
Create an instance of this class from thedeserializer
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
geometry :: IPoint :: defaultinit
geometry :: Point :: defaultinit
geometry :: Boxed :: defaultinit
core :: Object :: defaultinit
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
geometry :: Boxed :: intersects
Doesself
intersect with other
?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
redef class Point[N]
# Arctangent function using the difference between `self` and `other` as trigonometric ratio
#
# Behave similarly to the toplevel `atan2` as it returns the angle in the appropriate quadrant.
#
# ~~~
# var p0 = new Point[Float](0.0, 0.0)
# var p1 = new Point[Float](1.0, 1.0)
# assert p0.atan2(p1).is_approx(0.25*pi, 0.0001)
# ~~~
fun atan2(other: Point[N]): Float
do
var dx = other.x.to_f - x.to_f
var dy = other.y.to_f - y.to_f
return sys.atan2(dy.to_f, dx.to_f)
end
end
lib/geometry/angles.nit:20,1--36,3