New answers tagged

0 votes

How to draw line parallel to a line and tangent to a circle?

Tangent to a circle: with given direction One more Asymptote solution, additional to Thurston's answer. First time I learn that length (or time) of a circle is 4. // tangent to a circle: with given ...
  • 15.2k
4 votes

Assuming a line is tangent to a circle in tkz-euclide

Sometimes drawing can be done by going back from the conclusion of the mathematical problem. In drawing for this geometry problem, we start with a point A on the circle (O,R), then choose P and Q such ...
  • 15.2k
4 votes

Drawing an eighth of a sphere in tikz

For a reference, in Asymptote, we can use 1st way: built-in octant1 is the first 8th surface of the sphere, and can be drawn with draw(octant1,yellow); 2nd way: parametric equations of the sphere ...
  • 15.2k
3 votes
Accepted

Drawing an eighth of a sphere in tikz

With the tikz-3dplot package, you can easily rotate the planes which facilitates drawing. But actually, you just need to draw three quarter circles on the three planes (xy, xz and yz) and shade them ...
3 votes

How to draw a double napped cone with TikZ

An Asymptote solution for fun! I have not cleaned my code yet. Without opacity (opacity(1)) With opacity(.5) // http://asymptote.ualberta.ca/ import graph3; currentprojection=orthographic(2,2,.5,...
  • 15.2k
3 votes
Accepted

no matching function 'operator *(transform, void)'

You may note the difference between function label() and object label and how function rotate() relates to them. In particular, the signature of label() is void label(Label L, triple position); which ...
  • 3,555
0 votes

Drawing a Plane in 3D space

An Asymptote answer for an old question. Here p=plane(A,B) is the plane (parallelogram) O--A--A+B--B--cycle that we can fill the inside draw(surface(p),magenta+opacity(.2)); and draw the boundary ...
  • 15.2k
1 vote

What is the correct way to load in asymptote a bitmap image with precise scaling?

The main thing to know is that labels are not scaled by the size and unitsize commands. For example, I have modified your code below to show that a 7cm label is the same width as the grid that you ...
  • 4,507
4 votes
Accepted

Vector Field in Metapost

New: There are 3 kinds of phase portraits: slope field, direction field, vector field. In this situation, I choose direction field with normalized length of the vectors (in my taste ^^, that is .1*...
  • 15.2k
5 votes

Vector Field in Metapost

I am not sure whether this is what you want, but you could do the following using Metapost: s := 1.5cm ; vardef u(expr x,y) = (y+x*x-0.25*x*(y-1+2*x*x)) enddef ; vardef v(expr x,y) = (-2*x*(1+y)) ...
6 votes
Accepted

Draw a 3D solenoid using tikz

This is an Asymptote solution with the module tube. I choose brown+gray for the color of the copper string. Feel free to change to another color, for example https://colorcodes.io/brown/copper-color-...
  • 15.2k
2 votes
Accepted

How to pass code to asymptote from the command line?

I would recommend defining i before usersetting(): int i; usersetting(); write(i); That way the user can enter either asy asyfile -u i=5 or asy asyfile on the command line.
2 votes

How to pass code to asymptote from the command line?

Marijn's comment inspired me to read the remainder of the Command-Line Options section in the manual. I discovered that I was misusing the -u option. I needed to add a usersetting(); command to my ...
  • 4,507

Top 50 recent answers are included