Slide 48
Slide 48 text
#include ;
typedef void* Point;
typedef double f64;
int main() {
Cell p1 = NEW_CELL(new_point(10, 20));
Cell p2 = NEW_CELL(new_point(30, 10));
printf("%f", length(p1, p2));
}
double length(Cell c1, Cell c2) {
Point p1 = BORROW(c1);
Point p2 = BORROW(c2);
return line_len(p1, p2);
}