{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "da7f1bfe-b499-4682-bc76-53abe52dbcfa", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "var('x,y,z')\n", "p=x^3+y^3+z^3+1-0.25*(x+y+z+1)^3\n", "r=5\n", "color='aquamarine'\n", "s = implicit_plot3d(p==0, (x,-r,r), (y,-r,r), (z,-r,r), plot_points=100, region=lambda x,y,z: x**2+y**2+z**2<=r*r, color=color)\n", "s.show(frame=False, viewer='threejs')" ] }, { "cell_type": "code", "execution_count": 7, "id": "ebffd5a8-c58d-4552-b578-e0171f83ff8e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "x^3 - (x + y + z + 1)^2*(0.250000000000000*x + 0.250000000000000*y + 0.250000000000000*z + 0.250000000000000) + y^3 + z^3 + 1" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x*x*x+y*y*y+z*z*z+1-0.25*(x+y+z+1)*(x+y+z+1)*(x+y+z+1)" ] }, { "cell_type": "code", "execution_count": null, "id": "b86da0c6-c6ca-4857-bac0-312101edd7ca", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "SageMath 10.4.beta5", "language": "sage", "name": "sagemath" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.1" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }