# Path: clrs/_src/algorithms/geometry.py
# def segments_intersect(xs: _Array, ys: _Array) -> _Out:
#   def cross_product(x1, y1, x2, y2):
#   def direction(xs, ys, i, j, k):
#   def on_segment(xs, ys, i, j, k):
# def graham_scan(xs: _Array, ys: _Array) -> _Out:
#   def counter_clockwise(xs, ys, i, j, k):
# def jarvis_march(xs: _Array, ys: _Array) -> _Out:
#   def counter_clockwise(xs, ys, i, j, k):


from absl.testing import absltest
from absl.testing import parameterized
from clrs._src.algorithms import geometry
import numpy as np
# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

"""Unit tests for `geometry.py`."""




class GeometryTest(parameterized.TestCase):

  def test_segments_simple(self):
    xs_no = np.array([0, 0, 1, 1])
    ys_no = np.array([0, 1, 0, 1])

# Path: clrs/_src/algorithms/geometry.py
# def segments_intersect(xs: _Array, ys: _Array) -> _Out:
#   def cross_product(x1, y1, x2, y2):
#   def direction(xs, ys, i, j, k):
#   def on_segment(xs, ys, i, j, k):
# def graham_scan(xs: _Array, ys: _Array) -> _Out:
#   def counter_clockwise(xs, ys, i, j, k):
# def jarvis_march(xs: _Array, ys: _Array) -> _Out:
#   def counter_clockwise(xs, ys, i, j, k):


# Path: clrs/_src/algorithms/geometry_test.py
from absl.testing import absltest
from absl.testing import parameterized
from clrs._src.algorithms import geometry
import numpy as np

# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

"""Unit tests for `geometry.py`."""




class GeometryTest(parameterized.TestCase):

  def test_segments_simple(self):
    xs_no = np.array([0, 0, 1, 1])
    ys_no = np.array([0, 1, 0, 1])

    out, _ = geometry.segments_intersect(xs_no, ys_no)