Skip to content

Commit a40108f

Browse files
committed
move images
1 parent 1c3bf13 commit a40108f

32 files changed

+26
-699
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Access blog at https://rakita.github.io/blog/

content/blog/.DS_Store

0 Bytes
Binary file not shown.

content/blog/2d_transformations.md renamed to content/blog/2d_transformations/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ Rotation is little bit more complex (it has little bit more to do) but in same r
4444

4545
And we come to scaling, it is best part of this post (it has pictures) :D. We will gradually introducing few things that needs to be done in scaling, we will see how we handle rotation, and shift controls (shift is usually used for aspect ration lock).
4646

47-
![Naive Scale](/2d_transformations/naive_scale.png)
47+
![Naive Scale](./naive_scale.png)
4848

4949
Nice, lets start with basic example where our element is not rotated or translated and we just want to scale it. We will use `ref_point` (corner or side usually), and its `anchor_point` and of course we will need `current_point` to tell us where we want to scale to. We calculate `diff=current_point-anchor_point`, get scale as `s=scale(diff/element_size)` and we are done, we have scale matrix that can add to our transformation.
5050

5151
Okay, lets now look on example where we want to take top left corner `ref_point` ( you can follow picture below), in that case our `anchor_point` is positioned at bottom and if we want to scale it properly, to top and left. First difference from previous example is that we will need to move our object so that `anchor_point` is in `(0.0)` coordinate! We still need `diff` and we are calculating it same as before, but because now our axis are flipped, this is second difference, we need to reverse sign of `diff_new=Vector(-diff.x,-diff.y)`. Note, reversing `y` is needed for top side `ref_point` and reversing `x` for left side `ref_point`. We get scale as `s=scale(diff_new/element_size)` . And final third difference from previous example is that after all this we need to take translation of anchor `T=translate(anchor_point)`, calculate inverse `Tinv=inverse(T)` and bind it all together (from left to right) `S=T*s*Tin`.
5252

53-
![Scale](/2d_transformations/scale.png)
53+
![Scale](./scale.png)
5454

5555
As you can see diff vector is oriented to negative in reference to our axis, this is reason why we need to flip it, if we didn't do flipping you would get small scale when moving away from top left corner.
5656

@@ -62,7 +62,7 @@ That's great, but how to append scale in current matrix, when scale is something
6262

6363
Shift scale is scaling where aspect ration is not changed. This means that scale on both axis is equal and we need to choose which axis orientation we will take as primary. We could make it simple and depending on which corner_id is selected that take modulo of two and chose x or y scale, this will work but will be unintuitive. For better solution where depending on position of mouse relative to diagonal of element we will get smother transition between x and y orientation. See picture below:
6464

65-
![Naive Scale](/2d_transformations/shyft_scale.png)
65+
![Naive Scale](./shyft_scale.png)
6666

6767
With transparent colors we can see zones where we want to take only `x` ( blue color) or take only `y` (marked with red). As noticeable our object is in original position that means our `original_points` is calculated same as in example with rotated object. Slope of diagonals that make these zones are calculated from `original_size` with equation `line_slope = original_size.y/original_size.x` . for second diagonal it is enough to just flip sign and we will get second slope. what we want to check is if point is in blue or red space and we can do that following if statement: (for abbreviate: `op` is `original_point` , `ls` is `line_slope` ): `(op.y < ls**op.x && op.y > -ls**op.x) || (op.y > op.x**ls && op.y < -ls**op.x)`, and if this if statement is true do `scale.y=scale.x` if it is false do opposite. And lastly don't forget that when you are overriding one scale to not override its sign, in example from picture we are taking `y` scale and overriding `x` scale but we need to preserve `x` sign to properly scale our element `x=sign(x)*abs(y)`.
6868

content/blog/hello-world.md

-41
This file was deleted.

content/blog/parallel_evm_claim.md renamed to content/blog/parallel_evm_claim/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ We have two transactions that read/write to the **same** state (there is only on
3030

3131
[Mermaid graph](https://mermaid.live/edit#pako:eNpdTrsOwjAQ-5XII2oGOmZgYmViJAyn5gqRmgSlFwSq-u8cMCDhyfJD9oKhBIbDLCS8j3SplOy999koTpuzsXZn5LH9F3p0SFwTxaDt5W17yJUTezilgUdqk3j4vGqUmpTjMw9wUht3aLfw24MbaZpV5RCl1MP30efY-gKkKDNp)
3232

33-
![](/parallel_evm_claim/example_2tx.png)
33+
![](./example_2tx.png)
3434

3535

3636
For the sake of explaining we are simplifying state and seeing it as a list of accounts, these "accounts" can be a balance/nonce/code hash(code)/storage slot, it is just easier to reason and think about in simpler form.
@@ -48,7 +48,7 @@ Running transactions in parallel is more implementation detail and will depend o
4848

4949
The second example is having a third transaction that depends on the first one.
5050

51-
![](/parallel_evm_claim/example_chain.png)
51+
![](./example_chain.png)
5252

5353

5454
[Graph](https://mermaid.live/edit#pako:eNpdjjEOwjAMRa8SeUTNQMuUgYmViZEwWI0LkZoEpU4Fqnp3DC1CwtPX-7b1JmiTIzAwMDIdPF4zBj3WNiqZ8-aitN4rfmwXIGEFzRc0K9j9n9RQQaAc0Dv5P71rC3yjQBaMREcdlp4t2DjLKhZOp2dswXAuVEG5u58RmA77QSg5zykfF-eP-vwC_v88KA)
@@ -61,7 +61,7 @@ This example show's us that marking of state can be done by chain ids that this
6161

6262
Modelling dependency can be tricky but in parallel execution, there are only two synchronizations that can happen. And those are forks and joins and both of them can be seen in the picture.
6363

64-
![](/parallel_evm_claim/example_fork_join.png)
64+
![](./example_fork_join.png)
6565

6666

6767
[Graph](https://mermaid.live/edit#pako:eNpdj7EOwjAMRH-l8oiagRSWDEysTIwNg9W4EKlJUOogUNV_J9BWFXg6vTtZdwM0wRAo6BmZjhavEZ14SO2LfPXmUghxKPi5nUAWM6gWUM1g95_YL0D-gvWphBIcRYfW5AbDx9bAN3KkQWVpqMXUsQbtxxzFxOH88g0ojolKSHezdgbVYtdnSsZyiKdp1Xfc-AaEXkTp)
@@ -77,7 +77,7 @@ This is a good example that tests our initial mechanism of marking of accessed s
7777

7878
[Graph](https://mermaid.live/edit#pako:eNpd0D0PgjAQBuC_Qm40MMiHJB2cXJ0crcOFHkpCKSlXoyH8d6uUmPSmy3PvcHczNEYRCJgYmU4d3i3q7JnLIfF13d2SLDsm_Nqv4JsAxQZFgDJOVBvkMZQBDhtUAeo4Ucd75JCCJquxU37p-TuWwA_SJEH4VlGLrmcJclh8FB2by3toQLB1lIIb1f9MEC32k1dSHRt7Xh_x-8fyAQIhUhg)
7979

80-
![](/parallel_evm_claim/example_diamont.png)
80+
![](./example_diamont.png)
8181

8282

8383
All previous statements should be valid here.

0 commit comments

Comments
 (0)