Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why the showing results of mpl_toolkits and pyganja are different? #6

Open
HubChangWang opened this issue Apr 20, 2020 · 3 comments
Open

Comments

@HubChangWang
Copy link

HubChangWang commented Apr 20, 2020

from clifford.g3c import *
from matplotlib import pyplot as plt
import mpl_toolkits.clifford
from math import *
from pyganja import GanjaScene, draw
import pyganja; pyganja.__version__

plt.ioff()  # we'll ask for plotting when we want it
from clifford.tools import classify as cla
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1, projection='3d')

point = up(0.2 * e1 + 0.3 * e2 + 0.5 * e3)
point1 = up(0.2 * e1 + 0.3 * e2 + 0.8 * e3)
S1 = point - 0.1 * einf
S2 = point1 - 0.1 * einf
circle2 = S1 ^ S2
plane=((circle2.dual())^einf)




sc = GanjaScene()
sc.add_object(circle2.dual(), color=(128, 0, 0), label='plane')
sc.add_object(plane, color=(0, 0, 100), label='point')
draw(sc)


mpl_toolkits.clifford.plot(ax1, [circle2.dual()], color='tab:blue')
mpl_toolkits.clifford.plot(ax1, [plane], color='tab:red')
fig.tight_layout()
# show the figure
plt.show()
@hugohadfield
Copy link
Member

Hi there, looks like this is a normalisation issue. If you change
mpl_toolkits.clifford.plot(ax1, [circle2.dual()], color='tab:blue') mpl_toolkits.clifford.plot(ax1, [plane], color='tab:red')
to
mpl_toolkits.clifford.plot(ax1, [circle2.dual().normal()], color='tab:blue') mpl_toolkits.clifford.plot(ax1, [plane.normal()], color='tab:red')
you will get the correct visualisation.

@eric-wieser does the mpl_toolkit do normalisation before extraction of objects parameters etc?
If not we should probably add it

@eric-wieser
Copy link
Member

I think the issue lies in the (lack of) epsilon handling in clifford.tools.classify, not this package

@HubChangWang
Copy link
Author

Hi there,@hugohadfield @eric-wieser, thank you for your advice, problem solved by adding the .normal() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants