<commit_before>package com.powerdata.openpa.tools;

/**
 * Complex number in polar form
 * 
 * @author <EMAIL>
 *
 */

public class PComplex
{
	private float _r;
	private float _theta;
	
	public static final Complex Zero = new Complex(0,0);

	public PComplex(float r, float theta)
	{
		_r = r;
		_theta = theta;
	}

	public float r() {return _r;}
	public float theta() {return _theta;}
	
	public PComplex mult(PComplex v) {return new PComplex(_r*v.r(), _theta+v.theta());}
	public PComplex mult(Complex v) {return mult(v.polar());}

	public PComplex div(PComplex v) {return new PComplex(_r/v.r(), _theta-v.theta());}
	
	public Complex cartesian()
	{
		return new Complex((float) (_r * Math.cos(_theta)),
				(float) (_r * Math.sin(_theta)));
	}
}

<commit_msg>add remaining methods for polar form of complex<commit_after>package com.powerdata.openpa.tools;

/**
 * Complex number in polar form
 * 
 * @author <EMAIL>
 *
 */

public class PComplex
{
	private float _r;
	private float _theta;
	
	public static final PComplex Zero = new PComplex(0,0);

	public PComplex(float r, float theta)
	{
		_r = r;
		_theta = theta;
	}

	public float r() {return _r;}
	public float theta() {return _theta;}
	
	public PComplex mult(PComplex v) {return new PComplex(_r*v.r(), _theta+v.theta());}
	public PComplex mult(float r, float theta) {return new PComplex(_r*r, _theta + theta);}
	public PComplex mult(float scalar) {return new PComplex(_r * scalar, _theta);}

	public PComplex div(PComplex v) {return new PComplex(_r/v.r(), _theta-v.theta());}
	public PComplex div(float r, float theta) {return new PComplex(_r/r, _theta/theta);}
	public PComplex div(float scalar) {return new PComplex(_r / scalar, _theta);}
	
	public PComplex inv() {return new PComplex(1F/_r, -_theta);}
	
	public Complex cartesian()
	{
		return new Complex((float) (_r * Math.cos(_theta)),
				(float) (_r * Math.sin(_theta)));
	}
}


{'fraction_non_alphanumeric': 0.14036939313984167, 'fraction_numerical': 0.002638522427440633, 'mean_word_length': 4.252077562326869, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '71547', 'n_tokens_mistral': 690, 'n_tokens_neox': 644, 'n_words': 201}