5

I have a question on how to draw an angle bisector in asymptote? I've seen others use tikz and others but not a lot using asymptote. Also I've seen this before and one of them used asymptote, but with all the color and other commands I'm not really sure how he/she did it. Here is the triangle for reference:

\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[inline]{asymptote}
\usepackage{float}
\usepackage{fullpage}
\usepackage{wrapfig}

\title{Triangles}
\author{DandelionDreams}
\date{July, 2020}

\begin{document}

\maketitle

\noindent
\begin{minipage}{0.49\textwidth} 
\begin{flushleft}
\textbf{Incenter}

An incenter is the intersection of the three angle bisectors of a triangle, which is usually denoted by $I$.
\end{flushleft}
\end{minipage}% no blank line after
\begin{minipage}{0.49\textwidth} 

\begin{flushright}
\begin{asy}
    pair A, B, C, D;
    A = (80,80);
    B = (0,0);
    C = (120,0);
    draw((0,0)--(80,80)--(120,0)--cycle);
    label("$A$", A, N);
    label("$C$", C, SE);
    label("$B$", B, SW);
    \end{asy}
\end{flushright}    
\end{minipage}


\end{document}

I want to draw the angle bisector of angle{BAC} AD, intersecting BC at D.

Note: A newbie to asy here! Also I'm pretty new to tex.stackexchange too, as I've only asked one question a few days ago. Please point out anything that I need to change and thanks a lot!

4
  • Hi and welcome. Please give a fully compilable code.
    – AndréC
    Commented Jul 15, 2020 at 19:09
  • @AndréC I'm sorry I'm not really sure what you mean? Do you think this edit makes sense for you? Commented Jul 15, 2020 at 19:20
  • 1
    It's almost perfect now.
    – AndréC
    Commented Jul 15, 2020 at 19:33
  • 1
    Useful to potential answerers: piprime.fr/files/asymptote/geometry/modules/… Commented Jul 15, 2020 at 20:10

3 Answers 3

6

As suggested by Charles Staat, Asymptote provides a 2D geometry extension geometry.asy : you can manage triangles, conic, circles, lines, segments, coordinate system with appropriate (C++ like) structures. Please find a possible solution to your question

import geometry;
point A, B, C, D;
A = (80,80);
B = (0,0);
C = (120,0);
triangle tABC=triangle(A,B,C);
draw(tABC);
line ba=bisector(tABC.VB); 
draw(ba);
point D=bisectorpoint(tABC.AC);

label("$A$", A, N);
label("$C$", C, SE);
label("$B$", B, S);
label("$D$", D,2N+E);

and the associated picture

enter image description here

0
3

Compile here: http://asymptote.ualberta.ca/

This example has more informations.

usepackage("esvect");
unitsize(1cm);
pair A=(0,0),B=(4,0),C=(3,2);
pair M=dir(A--B),N=dir(A--C);
pair A1=dir(A--M,A--N);
pair D=extension(A,A1,B,C);
draw(A--B--C--cycle);
draw(A--D);
draw(A--N--(N+M-A)--M--cycle,green);
draw(Label("$\vv{AM}$"),A--M,blue,Arrow);
draw(A--A1,gray,Arrow);
draw(rotate(degrees(N-A))*Label("$\vv{AN}$",LeftSide),A--N,red,Arrow);
draw(M--N);
dot("$A$",A,dir(180));
dot("$B$",B);
dot("$C$",C);
dot("$D$",D);

enter image description here

0
2

A PSTricks solution only for either fun purposes or comparison.

\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-eucl}
\begin{document}
\begin{pspicture}[showgrid](5,6)
    \pstGeonode[CurveType=polyline](5;80){A}(1,1){B}(5;40){C}
    \pstBissectBAC[linecolor=red]{C}{B}{A}{N}
\end{pspicture}
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .