<jupyter_start><jupyter_text>TextThere are three kinds of text objects: - on the 3d scene `k3d.text`, renderes in canvas - on the 2d canvas `k3d.text2d`, renderes in canvas - renders as texture in WebGL  `k3d.texture_text`<jupyter_code>import k3d
import numpy as np 


plot = k3d.plot()
g = 9.81
v0 = 24
alpha = np.radians(45)
t_end = 2*v0*np.sin(alpha)/g
t = np.linspace(0,t_end,100) 

# note .T at the end, k3d takes data (x1,y1,z1),(x2,y2,z2)...
traj3d = np.stack([ v0*t*np.cos(alpha), \
                    np.zeros_like(t), \
                    v0*t*np.sin(alpha)-g*t**2/2 ]).T.astype(np.float32)

plt_traj = k3d.line(traj3d) 
plt_text = k3d.text('h_{max}', position=[np.cos(alpha)*t_end*v0/2, 0, (v0*np.sin(alpha))**2/(2*g)], color=0xff0000, size=2)
plt_text2d = k3d.text2d(r'\text{ballistic trajectory: } h=v_0 t \sin \alpha - \frac{g t^2}{2}', \
                        position=[0.0, 0.0], color=0x0000ff, size=1)
plt_texture_text = k3d.texture_text('START', position=[0, 0, 0],\
                                    font_face='Calibri', color=255, size=4)

plot += plt_text 
plot += plt_text2d 
plot += plt_texture_text
plot += plt_traj

plot.display()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1686241610738255, 'fraction_numerical': 0.06375838926174497, 'mean_word_length': 3.2455516014234878, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '221162', 'license': 'MIT', 'n_tokens_mistral': 542, 'n_tokens_neox': 509, 'n_words': 100, 'path': 'docs/source/basic_functionality/Text.ipynb', 'repo_name': 'annefou/K3D-jupyter', 'size': '1192'}