You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
float IsNotFirstSlice = clamp( ThreeSliceSelector, 0.0,1.0 ); // 1 if NOT the first slice (true for slices 1 and 2)
191
+
float IsNotSecondSlice = clamp( ThreeSliceSelector-1.0, 0.0,1. ); // 1 if NOT the first or second slice (true only for slice 2)
192
+
193
+
return mix( ScrollingRGB.xyz, mix( ScrollingRGB.zxy, ScrollingRGB.yzx, IsNotSecondSlice ), IsNotFirstSlice ); // Make the RGB rotate right depending on final slice index
Copy file name to clipboardExpand all lines: lib/src/vector.dart
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,9 @@ class Vector {
120
120
returnthis;
121
121
}
122
122
123
+
// The cross product results in a vector perpendicular to the two input vectors
124
+
// The result's magnitude is equal to the magnitudes of the two inputs multiplied together and then multiplied by the sine of the angle between the inputs.
125
+
// Or in other words the result's magnitude is equal to the area of the parallelogram that the two input vectors span.
123
126
Vectorcross( Vector vec2) {
124
127
returncross2( this, vec2);
125
128
}
@@ -134,6 +137,8 @@ class Vector {
134
137
returnthis;
135
138
}
136
139
140
+
// The dot product is a float value equal to the magnitudes of the two vectors multiplied together and then multiplied by the cosine of the angle between them.
141
+
// For normalized vectors Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions and zero if the vectors are perpendicular.
0 commit comments