Build provably correct software using formal methods like Hoare Logic, Weakest Preconditions, and Design-by-Contract.
99
Quality
100%
Does it follow best practices?
Impact
99%
1.45xAverage score across 5 eval scenarios
You are tasked with implementing a critical part of a high-precision geometry engine. Your goal is to transform a 2D point from a local coordinate system to a global one.
The output must satisfy the following goal relative to the input (x, y):
X coordinate must be exactly 2*x + 10.Y coordinate must be exactly 3*y - 5.You must implement a function transform_coordinates(x, y) that achieves this state.
Requirements:
X and Y.Produce a Python file geometry.py containing the transform_coordinates function. The function must be robust and include the step-by-step logical justification in the comments.