⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 partview.m

📁 The CUBA library provides new implementation of four general-purpose multidimensional integration al
💻 M
字号:
(*	partview.m		A partition viewer for Cuba results in Mathematica		last modified 4 Feb 05 th*)BeginPackage["Cuba`"]PartView::usage = "For a Cuba result obtained with Regions -> True,PartView[result, dimx, dimy] displays the dimx-dimy plane of thetessellation used in the integration."Rect::usage = "Rect[{x1, y1}, {x2, y2}] is the graphics primitive usedby PartView to render a rectangle."Begin["`PartView`"]PartView[expr_, dimx_Integer, dimy_Integer] :=Block[ {r, g, maxarea},  r = Cases[expr,    Region[ll_, ur_, ___] :> {ll[[{dimx, dimy}]], ur[[{dimx, dimy}]]},    Infinity];  maxarea = Times@@ (Max/@ #2 - Min/@ #1 &)@@ Transpose[r, {3, 1, 2}];  (Show[#]; #)& @ Graphics[Apply[Rect, r, 1], AspectRatio -> 1]]maxarea = 1Rect[{l_, d_}, {r_, u_}] := {  { Hue[0, (ArcSin[1 - (r - l) (u - d)/maxarea]/(Pi/2))^2, 1],    Rectangle[{l, d}, {r, u}] },  { RGBColor[0, 0, 0],    Line[{{l, d}, {r, d}, {r, u}, {l, u}, {l, d}}] }}End[]EndPackage[]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -