MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / get_y

Method get_y

digital_image_processing/resize/resize.py:48–59  ·  view source on GitHub ↗

Get parent Y coordinate for destination Y :param y: Destination X coordinate :return: Parent X coordinate based on `y ratio` >>> nn = NearestNeighbour(imread("digital_image_processing/image_data/lena.jpg", ... 1), 100, 100)

(self, y: int)

Source from the content-addressed store, hash-verified

46 return int(self.ratio_x * x)
47
48 def get_y(self, y: int) -> int:
49 """
50 Get parent Y coordinate for destination Y
51 :param y: Destination X coordinate
52 :return: Parent X coordinate based on `y ratio`
53 >>> nn = NearestNeighbour(imread("digital_image_processing/image_data/lena.jpg",
54 ... 1), 100, 100)
55 >>> nn.ratio_y = 0.5
56 >>> nn.get_y(4)
57 2
58 """
59 return int(self.ratio_y * y)
60
61
62if __name__ == "__main__":

Callers 1

processMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected