from math import *
class LC:
	__K11=None
	__K22=None
	__K33=None
	__q0=None	#chirality / natural twist of LC
	def __init__(self, K11, K22, K33, q0, e_para, e_perp):
		self.__K11=K11
		self.__K22=K22
		self.__K33=K33
		self.__q0=q0
		self.__e_para=e_para	#permittivity parallel
		self.__e_perp=e_perp	#permittivity perperdicular
	def k1(self,theta):
		return self.__K11*sin(theta)**2+self.__K33*cos(theta)**2
	def k2(self,theta):
		return (self.__K22*sin(theta)**2+self.__K33*cos(theta)**2)*sin(theta)**2
	def k3(self,theta):
		return 2*self.__K22*sin(theta)**2
	def dk1(self, theta):
		return sin(2*theta)*(self.__K11-self.__K33)
	def dk2(self, theta):
		return sin(2*theta)*(2*self.__K22*sin(theta)**2+self.__K33*cos(2*theta))
	def dk3(self, theta):
		return 2*self.__q0*self.__K22*sin(2*theta)
	def e_zz(self, theta):
		return e_perp*sin(theta)**2+e_para*cos(theta)**2
