RStudio 中的渐近线

RStudio 中的渐近线

最近,我发现一个惊人的事实:如果我们访问网站art of problem solving,使用copypaste.RmdRStudio我们可以直接获得latex数学方程式的代码。这很好。但对于图片部分,asymptote代码无法被识别RStudio

例如,这里例子,代码如下

Problem
Steph scored $15$ baskets out of $20$ attempts in the first half of a game, and $10$ baskets out of $10$ attempts in the second half. Candace took $12$ attempts in the first half and $18$ attempts in the second. In each half, Steph scored a higher percentage of baskets than Candace. Surprisingly they ended with the same overall percentage of baskets scored. How many more baskets did Candace score in the second half than in the first?[asy] size(7cm); draw((-8,27)--(72,27)); draw((16,0)--(16,35)); draw((40,0)--(40,35)); label("12", (28,3)); draw((25,6.5)--(25,12)--(31,12)--(31,6.5)--cycle); draw((25,5.5)--(31,5.5)); label("18", (56,3)); draw((53,6.5)--(53,12)--(59,12)--(59,6.5)--cycle); draw((53,5.5)--(59,5.5)); draw((53,5.5)--(59,5.5)); label("20", (28,18)); label("15", (28,24)); draw((25,21)--(31,21)); label("10", (56,18)); label("10", (56,24)); draw((53,21)--(59,21)); label("First Half", (28,31)); label("Second Half", (56,31)); label("Candace", (2.35,6)); label("Steph", (0,21)); [/asy]$\textbf{(A) } 7\qquad\textbf{(B) } 8\qquad\textbf{(C) } 9\qquad\textbf{(D) } 10\qquad\textbf{(E) } 11$

Solution 1 (Inequalities)
Let $x$ be the number of shots that Candace made in the first half, and let $y$ be the number of shots Candace made in the second half. Since Candace and Steph took the same number of attempts, with an equal percentage of baskets scored, we have $x+y=10+15=25.$ In addition, we have the following inequalities:\[\frac{x}{12}<\frac{15}{20} \implies x<9,\]and\[\frac{y}{18}<\frac{10}{10} \implies y<18.\]Pairing this up with $x+y=25$ we see the only possible solution is $(x,y)=(8,17),$ for an answer of $17-8 = \boxed{\textbf{(C) } 9}.$

除图片部分(渐近线部分)外,一切都可以顺利进行。

我想知道我们是否可以进去asymptoteRStudio顺便说一句,这里有教程教程

答案1

是的,这是可能的。这与 RStudio 无关,它只是一个 IDE(但它确实大大简化了流程)。

您必须将 Asymptote 代码与asy引擎一起放入一个块中:

``{r asy-example, engine = "asy", fig.cap = "Asymptote 3D Example", fig.ext = 'png'}
import graph3;
import palette;
size(200,300,keepAspect=false);
currentprojection=orthographic(10,10,30);
currentlight=(10,10,5);
triple f(pair t) {return (exp(t.x)*cos(t.y),exp(t.x)*sin(t.y),t.y);}
surface s=surface(f,(-4,-2pi),(0,4pi),8,16,Spline);
s.colors(palette(s.map(zpart),Rainbow()));
draw(s,render(merge=true));
```

相关内容