A parallelogram has coordinates (0, 0), (144, 0), (377, 89) and (233, 89).
Determine the number of lattice points strictly within the interior of the parallelogram.
(In reply to
solution - discrepancy by Larry)
Larry's right:
clearvars
ct=0;
for x=1:376
for y=1:88
if y<89*x/233
if y>89*(x-144)/(377-144)
ct=ct+1;
end
end
end
end
ct
finds
>> latticeInParallelogram
ct =
12672
|
Posted by Charlie
on 2024-12-23 12:49:01 |