diff --git a/articles/2024/daily.md b/articles/2024/daily.md new file mode 100644 index 0000000..27f376c --- /dev/null +++ b/articles/2024/daily.md @@ -0,0 +1,11 @@ +## 2024-7-12 + +做渲染真的很苦,没啥可喜的地方,每个人的理解也是存在很大的差异的。 + +## 2024-7-11 + +《高效能人士的七个习惯》中提到一个事实,就是人类在技术发展的最近几十年里,把人格魅力排到了道德修养之前了。 + +随着技术越来越多,越来越多人的理论知识的匮乏,联系实际能力的欠缺,逻辑思维能力的退化! + +人越来越容易产生分歧了,像电影《分歧者》中的场景越来越明显了,很多场景中悖论式的讨论越来越多,理智与非理智的对抗也越来越频繁。 diff --git a/cg/mesh/NURBS.md b/cg/mesh/NURBS.md index 6d03135..66dfe0c 100644 --- a/cg/mesh/NURBS.md +++ b/cg/mesh/NURBS.md @@ -1,5 +1,5 @@ # NURBS -> + 非均匀有理B样条, 这是一种数学表示3D几何的方法,能够准确描述从简单的2D线、圆、弧或曲线到非常复杂的3D自由曲面或实体的任何形状。如今,NURBS已成为CAD和计算机图形学的国际标准。 ## [The Nurbs Book]() @@ -7,6 +7,7 @@ ## 参考 +- [OpenNURBS is an open-source NURBS-based geometric modeling library and toolset, with meshing and display / output functions. ](https://github.com/OpenNURBS/OpenNURBS) - [A small C++ library containing some NURBS-based geometric modeling algorithms and features I've been working on since 2013.](https://gitlab.com/ssv/Mobius) - [LNLib is a C++ NURBS Algorithms Library. These algorithms are primary referenced from The NURBS Book 2nd Edition. ](https://github.com/BIMCoderLiang/LNLib) - [LNLibViewer is a 3d viewer matches C++ NURBS algorithm library LNLib](https://github.com/BIMCoderLiang/LNLibViewer) diff --git a/cg/threejs/grid.md b/cg/threejs/grid.md index 5d1a8fb..c100b6f 100644 --- a/cg/threejs/grid.md +++ b/cg/threejs/grid.md @@ -12,4 +12,19 @@ const distance = camera.position.length(); const logValue = 10 ** Math.ceil(Math.log(distance) / Math.log(10)); (this.material).uniforms.uSize.value = logValue / this.scaleSize; // 对上面的无穷网格利用这个逻辑可以面前实现网格的变化 +``` + +```c +float getGrid(float size) { + vec2 r = worldPosition.${planeAxes} / size; + // 基于变量的平滑步函数smooth step function + // r-0.5 居中,使其范围在[0,1] + // fract(r - 0.5)使其范围在[-0.5, 0.5] + // fract(r - 0.5) - 0.5使其范围在[-1, 0] + // abs(fract(r - 0.5) - 0.5)使其范围在[0, 1] + // fwidth(r)返回屏幕空间宽度或模糊度 + vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r); + float line = min(grid.x, grid.y); + return 1.0 - min(line, 1.0); +} ``` \ No newline at end of file diff --git a/cg/tools/glsl.md b/cg/tools/glsl.md new file mode 100644 index 0000000..44f3406 --- /dev/null +++ b/cg/tools/glsl.md @@ -0,0 +1,11 @@ +# [GLSL]() + +## 内置函数 +在图形编程中,pow 函数常用于计算光照模型中的衰减、颜色混合的伽马校正、模拟物体表面的物理属性(如反射率、折射率等)等。 +```js +// vndc = pos.xy / pos.w; from vertex +// mouse = [2*offsetx/w-1, 1-2*offsety/h] +// focused highlight +float falloff = 10.0; +float dif = pow(falloff, -clamp(length(mouse - vndc), 0.0, 1.0)); +``` \ No newline at end of file diff --git a/dev-note/maven.md b/dev-note/maven.md index 78206d1..334a9d3 100644 --- a/dev-note/maven.md +++ b/dev-note/maven.md @@ -1,6 +1,9 @@ -# Maven +# [Maven](https://maven.apache.org/) -maven 是打包工具,执行还是需要调用Java +Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. + +maven是项目管理工具,将项目分成了三个生命周期,clean,default,site + 是打包工具,执行还是需要调用Java ## 命令 @@ -14,11 +17,14 @@ maven 是打包工具,执行还是需要调用Java - mvn install - mvn clean install -Dmaven.test.skip=true -### springboot +### [Spring Boot Maven Plugin](https://docs.spring.io/spring-boot/maven-plugin/index.html) + +- [插件源码](https://github.com/spring-projects/spring-boot/tree/main/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin) Spring Boot 通过 Spring Boot Maven Plugin 在 Apache Maven 中提供了对 Spring Boot 的支持。 - mvn spring-boot:run +- mvn spring-boot:repackage - mvn package 打包后用java -jar来运行 调用springboot打包后的文件启动服务 diff --git a/exercises/advanced.mathematics.md b/exercises/advanced.mathematics.md index d9fc73f..9c69964 100644 --- a/exercises/advanced.mathematics.md +++ b/exercises/advanced.mathematics.md @@ -1,22 +1,52 @@ # 高等数学 > -## 例题1 2024-5-17 +## 2024-7-10 + +
+例题2 + +$$ +a_{1}=\sqrt(\frac{1}{2}), a_{n}=\sqrt{\frac{1+a_{n-1}}{2}}, \text{求} \lim\limits_{n \to \infty}a_{1}a_{2}a_{3}\cdots a_{n} +$$ + +求解: + +$$ +\text{由}a_{1}=\sqrt{\frac{1}{2}}, \text{不防设}a_{1}=cos{\frac{\theta}{2}}, \theta = \pi. \newline +\text{则由}a_{2}=\sqrt{\frac{1+cos{\frac{\theta}{2}}}{2}}=\sqrt{\frac{1}{2}(1+cos{\frac{\theta}{2}})}=\sqrt{\frac{cos^2{\theta}}{2^2}}=\frac{cos\theta}{2^2} \newline +\text{则可以推得} a_{n}=\frac{cos\theta}{2^n}. \text{则有} \newline +\lim\limits_{n \to \infty}a_{1}a_{2}a_{3} \cdots a_{n} \newline += \lim\limits_{n \to \infty}\frac{cos\frac{\theta}{2} cos\frac{\theta}{2^2} cos\frac{\theta}{2^3} \cdots cos\frac{\theta}{2^n}sin\frac{\theta}{2^n}}{sin\frac{\theta}{2^n}} \newline += \lim\limits_{n \to \infty}\frac{cos\frac{\theta}{2} cos\frac{\theta}{2^2} cos\frac{\theta}{2^3} \cdots cos\frac{\theta}{2^(n-1)} sin\frac{\theta}{2^(n-1)}}{2sin\frac{\theta}{2^n}} \newline += \lim\limits_{n \to \infty}\frac{sin{\theta}}{2^n sin\frac{\theta}{2^n}} \text{有基本极限式子} \lim\limits_{x \to 0}\frac{sinx}{x}=1 \newline += \lim\limits_{n \to \infty}\frac{\frac{1}{2^n} sin{\theta}}{sin\frac{\theta}{2^n}} \newline += \frac{sin{\theta}}{\theta} \newline +\text{因此} \lim\limits_{n \to \infty}a_{1}a_{2}a_{3}\cdots a_{n} = \frac{sin\frac{\pi}{2}}{\frac{\pi}{2}}=\frac{2}{\pi} +$$ + +
+ +## 2024-5-17 + +
+例题1 > **Note来源** > 吴康公众号 $$ \text{设}F(x) = sinx \cdot sin2x \cdots sin(2022x), \text{求}F^{2024}(0). \newline -\text{首先,把公式一般化,就是}F(x) = \prod _{\substack{1 \le k \le n}} {sin(kx)}, n \in N^+. \text{求 }F^{n+2}(0) +\text{首先,把公式一般化,就是}F(x) = \displaystyle \prod _{\substack{1 \le k \le n}} {sin(kx)}, n \in N^+. \text{求 }F^{n+2}(0) $$ 解: $$ \text{引入定理,证略} \newline -sinx = x - \frac{x^3}{6} + o(x^3), x \to 0 \text{带入可以得到} F(x) = \prod _{\substack{1 \le k \le n}} { \[ kx - \frac{kx^3}{6} + o(x^3) \]}, x \to 0 \newline +sinx = x - \frac{x^3}{6} + o(x^3), x \to 0 \text{带入可以得到} F(x) = \displaystyle \prod _{\substack{1 \le k \le n}} { \[ kx - \frac{kx^3}{6} + o(x^3) \]}, x \to 0 \newline F(x) \text{的展开式中}x^{n+2}\text{项为} \newline -\sum_{1 \le k \le n}{\[\prod_{1 \le k \le n}\]}(kx)^{-1} \cdot (-6^{-1})(kx)^3=-6^{-1}\lgroup{\sum_{1 \le k \le n}{k^2}}\rgroup n!x^{n+2} = -36^{-1}n(2n+1)(n+1)!(n+2)! + {\displaystyle \sum_{1 \le k \le n}}{\displaystyle \prod_{1 \le k \le n}}(kx)^{-1} \cdot (-6^{-1})(kx)^3=-6^{-1}\lgroup{\displaystyle \sum_{1 \le k \le n}{k^2}}\rgroup n!x^{n+2} = -36^{-1}n(2n+1)(n+1)!(n+2)! $$ +
\ No newline at end of file diff --git a/exercises/index.md b/exercises/index.md index a6cbcd4..67f177e 100644 --- a/exercises/index.md +++ b/exercises/index.md @@ -37,4 +37,8 @@ ### 感受 -- [2024](/exercises/2024.md) \ No newline at end of file +- [2024](/exercises/2024.md) + +
+xxx +
diff --git a/exercises/linear.algebra.md b/exercises/linear.algebra.md index 821ad3d..a2b16f0 100644 --- a/exercises/linear.algebra.md +++ b/exercises/linear.algebra.md @@ -69,4 +69,16 @@ AA^{T}=UDU^{T} \newline D\text{为特征值的对角矩阵,}V,U\text{为正交矩阵} $$ +[利用Weyl's不等式证明 Eckhart-Young定理](https://mp.weixin.qq.com/s/ErHlXWNvZC6vdPUZs2ycGQ) + +在现代机器学习中,降维处理数据中,很重要的工具也是SVD,即 + +$$ +A_{m \times n}=U_{m \times m} \sum_{m \times n} V_{n \times n}^{T} = \begin{bmatrix} u_{1} & \cdots & u_{m} \end{bmatrix} \begin{bmatrix} \sigma_{1} & & & & \newline & \cdots & & & \newline & & \sigma_{r} & & \newline & & & \cdots & \newline & & & & 0 \end{bmatrix} \begin{bmatrix} v_{1}^T \newline \vdots \newline v_{n}^T \end{bmatrix} = \textstyle \sum_{i=1}^{r} \sigma^{i}u_{i}v_{i}^T +$$ + +可以看到右边式子中的项数是r,与矩阵的秩相同,实际应用中,r很大,一个想法就是降低其值,用一个秩较低的矩阵来近似。SVD分解就具有这样的特性: + +任何秩k小于r的截断分解都能以最佳方式近似A,这是Eckhart-Young 定理的内容:当B等于A的截断SVD 时,Frobenius 范数(衡量原始矩阵A与任何低秩矩阵B之间的差异)将最小化 +