使用SVG画出脱氢维生素C的结构简式
बनाया गया: 6 मई 2025
बनाया गया: 6 मई 2025
使用SVG画出脱氢维生素C的结构简式
使用SVG画出脱氢维生素C的结构简式
下面是一段可直接嵌入 HTML 或 Markdown 的 SVG 代码,绘制了脱氢维生素 C(DHA)的常见结构简式。
(尺寸为 300 × 200 px,可按需修改 width/height 或坐标位置。)
svg<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200" viewBox="0 0 300 200" stroke="black" stroke-width="2" font-family="Helvetica, Arial, sans-serif" font-size="16"> <!-- 五元内酯环 --> <polyline points="100,100 140,80 180,100 170,140 130,140 100,100" fill="none"/> <!-- C2,C3 的双酮(=O) --> <line x1="140" y1="80" x2="140" y2="50"/> <line x1="145" y1="80" x2="145" y2="50"/> <text x="135" y="40">O</text> <line x1="180" y1="100" x2="210" y2="100"/> <line x1="180" y1="105" x2="210" y2="105"/> <text x="215" y="105" dominant-baseline="middle">O</text> <!-- 3‑OH --> <line x1="110" y1="70" x2="90" y2="55"/> <text x="75" y="55" dominant-baseline="middle">OH</text> <!-- 4‑OH --> <line x1="170" y1="140" x2="190" y2="160"/> <text x="195" y="165" dominant-baseline="middle">OH</text> <!-- 侧链羧基(γ‑羧基),通常书写为–COOH,这里用简式 --> <line x1="130" y1="140" x2="110" y2="165"/> <text x="82" y="170" dominant-baseline="middle">HOOC</text> </svg>
使用方法
.html 文件或支持 SVG 渲染的 Markdown 块,即可显示结构。width 和 height,或整体缩放 viewBox 与内部坐标。