MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / cos

Method cos

numericals.py:132–135  ·  view source on GitHub ↗
(self, other: Point)

Source from the content-addressed store, hash-verified

130 return np.sqrt(self.x**2 + self.y**2)
131
132 def cos(self, other: Point) -> float:
133 x, y = self.x, self.y
134 a, b = other.x, other.y
135 return (x * a + y * b) / self.norm() / other.norm()
136
137 def dot(self, other: Point) -> float:
138 return self.x * other.x + self.y * other.y

Callers 15

test_sketch_2l1cMethod · 0.80
test_sketch_s_angleMethod · 0.80
rotateaMethod · 0.80
sample_withinMethod · 0.80
naming_positionFunction · 0.80
head_fromFunction · 0.80
random_rfssFunction · 0.80
sketch_alineFunction · 0.80
sketch_amirrorFunction · 0.80
sketch_eqdia_quadrangleFunction · 0.80
sketch_pentagonFunction · 0.80

Calls 1

normMethod · 0.95

Tested by 3

test_sketch_2l1cMethod · 0.64
test_sketch_s_angleMethod · 0.64