Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
pp:l04 [2021/03/28 11:41] roxana_elena.stiuca wrong number |
pp:l04 [2023/03/22 18:54] (current) mihai.udubasa old revision restored (2021/03/28 20:51) |
||
---|---|---|---|
Line 75: | Line 75: | ||
2.5. Write a function which computes the transposition of a matrix: | 2.5. Write a function which computes the transposition of a matrix: | ||
- | $math[ tr \left(\begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{array}\right) = \left(\begin{array}{ccc} 1 & 4 & 6 \\ 2 & 5 & 8 \\ 3 & 6 & 9 \\ \end{array}\right) ] | + | $math[ tr \left(\begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{array}\right) = \left(\begin{array}{ccc} 1 & 4 & 7 \\ 2 & 5 & 8 \\ 3 & 6 & 9 \\ \end{array}\right) ] |
<code haskell> | <code haskell> | ||
Line 164: | Line 164: | ||
$math[ maskDiscard\left(\begin{array}{ccc} & & * \\ & & * \\ & & * \\ \end{array}\right) \left(\begin{array}{ccc} * & & * \\ * & & \\ * & & * \\ \end{array}\right) = \left(\begin{array}{ccc} & & \\ & & * \\ & & \\ \end{array}\right) ] | $math[ maskDiscard\left(\begin{array}{ccc} & & * \\ & & * \\ & & * \\ \end{array}\right) \left(\begin{array}{ccc} * & & * \\ * & & \\ * & & * \\ \end{array}\right) = \left(\begin{array}{ccc} & & \\ & & * \\ & & \\ \end{array}\right) ] | ||
- | 3.9. Implement the ''union'' of two images. | + | 3.9. Implement the ''union''' of two images. |
<code haskell> | <code haskell> | ||
- | union :: Image -> Image -> Image | + | union' :: Image -> Image -> Image |
- | union = | + | union' = |
</code> | </code> | ||
$math[ union \left(\begin{array}{ccc} & & * \\ & & * \\ & & * \\ \end{array}\right) \left(\begin{array}{ccc} * & & * \\ * & & \\ * & & * \\ \end{array}\right) = \left(\begin{array}{ccc} * & & * \\ * & & * \\ * & & * \\ \end{array}\right) ] | $math[ union \left(\begin{array}{ccc} & & * \\ & & * \\ & & * \\ \end{array}\right) \left(\begin{array}{ccc} * & & * \\ * & & \\ * & & * \\ \end{array}\right) = \left(\begin{array}{ccc} * & & * \\ * & & * \\ * & & * \\ \end{array}\right) ] | ||
Line 177: | Line 177: | ||
Test it with the following sequence | Test it with the following sequence | ||
<code haskell> | <code haskell> | ||
- | seq1 = transformation_sequence [invert, union mask, rotate90right] | + | seq1 = transformationSequence [invert, union' mask, rotate90r] |
</code> | </code> | ||