1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/structs/add.zok

16 lines
276 B
Text

struct Point {
field x
field y
}
def main(Point p, Point q) -> Point:
field a = 42
field d = 21
field dpxpyqxqy = d * p.x * p.y * q.x * q.y
return Point {
x: (p.x * q.y + q.x * p.y) / (1 + dpxpyqxqy),
y: (q.x * q.y - a * p.x * p.y) / (1 - dpxpyqxqy)
}