From 2b4b36963da25c1146d7855415ea3172699fb388 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 28 Nov 2025 21:37:41 -0500 Subject: [PATCH] update: add help function --- src/render.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/render.c b/src/render.c index 1dc2c09..18690f3 100644 --- a/src/render.c +++ b/src/render.c @@ -3,12 +3,20 @@ #include "common.h" #include "init.h" +inline double xy_to_b(double x, double y) { + double tanpsi2 = x*x+y*y; + double cotpsi2 = 1/tanpsi2; + double b = R0/sqrt(f(R0)*(1+cotpsi2)); + return b; +} + int MC_pixel_render(const System *system, int i, int j, const gsl_spline *spline, double *rgb, int pixel_render_max, double pixel_render_err){ double dw = (system->w)/(system->W); // width and hight of one pixel double x_lu = i*dw - (system->w)/2; double y_lu = -j*dw + (system->H)*dw/2; //TODO: fill the MC intergral + // linear rgb = ∫ rgb(χ, ϕ) sin^2(χ) χ'(ψ) dx dy return 0; }