ZyK_BotaN wrote: it is passed...
gives surprises for the beginner, in respect of implementation of "cycles"
Yes I already . But I hope bypass of Cartesian coordinates represents
The solved task. there or Stepanovsky tail or recursions.
Yes... I started to collect all source code. While .
import Text. Printf
width = 512
height = 512
g = [0x0003C712;
0x00044814;
0x00044818;
0x0003CF94;
0x00004892;
0x00004891;
0x00038710;
0x00000010;
0x00000010]
type Vector = (Double, Double, Double)
sum:: Vector> Vector> Vector
sum (x1, y1, z1) (x2, y2, z2) = (x1 + x2, y1 + y2, z1 + z2)
prod:: Vector> Double> Vector
prod (x, y, z) (r) = (r * x, r * y, r * z)
sprod:: Vector> Vector> Double
sprod (x1, y1, z1) (x2, y2, z2) = x1 * x2 + y1 * y2 + z1 * z2
norm:: Vector> Vector
==> norm (x, y, z) = prod (x, y, z) (1.0 / sqrt (sprod ((x, y, z) (x, y, z))));
I smoke. A dog .
card.hs:38:54: error:
* Couldn't match expected type ` (Double, Double, Double)> Vector'
with actual type ` (Double, Double, Double)'
* The function ` (x, y, z) ' is applied to one argument;
but its type ` (Double, Double, Double) ' has none
In the first argument of ` sprod ', namely ` ((x, y, z) (x, y, z))'
In the first argument of ` sqrt ', namely
` (sprod ((x, y, z) (x, y, z)))'

38  norm (x, y, z) = prod (x, y, z) (1.0 / sqrt (sprod ((x, y, z) (x, y, z))));
 ^^^^^^^^^^^^^^^^^^^