user88148: Note: [I am approximately two weeks into learning Arduino and hence have little experience with utilizing Phototransistors.]
My plan revolves around placing four identical Phototransisors which are spread approximately 10cm apart on a breadboard in a V configuration. Each Phototransistor is connected to one of the "analog In" pins respectively (I am using the Arduino Uno), with the long leg attached to 5V while the short leg is connected to ground via a 220-ohm resistor. In the center of this setup, I plan to place a servo that will face the direction of the light beam emitted from a flashlight.
(I want this project to be allocated in a dark room with any external lighting calibrated),The idea is to identify the phototransistor which has the highest analog value (closest to the light source). With this information, I want to be able to compute an approximate angle of the light source to then write it on my servo.
You can find the attached datasheets below (All the components are from the Arduino starter kit :) ).
[Datasheet for the Phototransistor]
[Datasheet for the Servo motor]
[Datasheet for the 220 ohm Resistor]
Here is what I have so far for the code:
#include <Servo.h>
Servo myServo;
const int transistorPin1 = A0;
const int transistorPin2 = A1;
const int transistorPin3 = A2;
const int transistorPin4 = A3;
void setup() {
  myServo.attach (10);
  Serial.begin (9600);
}
void loop() {
 int reading1 = analogRead (transistorPin1);
 int reading2 = analogRead (transistorPin2);
 int reading3 = analogRead (transistorPin3);
 int reading4 = analogRead (transistorPin4);
 int reading [] = {reading1, reading2, reading3, reading4}; //This is an array for the values:
 int maxReading = reading [0], maxSensor = 1; // I am setting the maximum reading and the Phototransistor that corresponds to it:
   for (int i = 1; i <= 3; i++){ //Setting this for the other three phototransistors:
     if (reading[i] > maxReading){  
     maxReading = reading[i];
     maxSensor = i + 1;
     }
   }
}

So my question is: What is the most efficient way to compute the angle of the lighsource? And is my method even relevant for this application?
Thank you for taking you time to read this! Your support will be very much appreciated!
Edit 1:
Explanation of my hardware setup:
This project is allocated on two connected breadboards which means that there are no moving parts. The only moving component is the one single servo that is fixed in position.
The phototransistors, (as mentioned above), are placed in a V configuration which too are stationary. The servo is allocated behind the phototransistors and can only rotate 180 degrees. (You can see the attached illustrations below, I apologize in advance for any technical errors or my horrible drawings.)


As you can visualize on the first image, I do not plan on a complete 360 degree rotation which probably complicates the issue further. Any suggestions on how I can code this would be greatly appreciated! Once again thank you for your time.

user37735: In principle, you only need two phototransistors, a left and a right one. The quotient of the values from the ad-convertor (Vleft/Vright) will tell you where to find the light source. If the quotient > 1 then the light source is at the left side, if the quotient < 1 then the light source is at the right side. Most likely there is no lineair relationship between the quotient and the angular position of the light source. This relationship depends on the housing and the positioning of the diodes in their housings. One possibility is to do a calibration beforehand and use a lookup table during operation. The calibration could be done by placing the breadboard with photodiodes on a rotating platform with the light source in front and then record Vleft and Vright at various angles (in 1 degree steps?) of the platform in relation to the light source.
If two photoresistors don't give you the required precision and/or range, you can use more photoresistors and use the pair which is best 'looking' in the direction of the light source.

88148: <p><strong>Note: [I am approximately two weeks into learning Arduino and hence have little experience with utilizing Phototransistors.]</strong></p>
<p>My plan revolves around placing four identical Phototransisors which are spread approximately 10cm apart on a breadboard in a V configuration. Each Phototransistor is connected to one of the &quot;analog In&quot; pins respectively (I am using the Arduino Uno), with the long leg attached to 5V while the short leg is connected to ground via a 220-ohm resistor. In the center of this setup, I plan to place a servo that will face the direction of the light beam emitted from a flashlight.</p>
<p>(I want this project to be allocated in a dark room with any external lighting calibrated),The idea is to identify the phototransistor which has the highest analog value (closest to the light source). With this information, I want to be able to compute an approximate angle of the light source to then write it on my servo.</p>
<p>You can find the attached datasheets below (All the components are from the Arduino starter kit :) ).</p>
<p><a href="https://www.arduino.cc/documents/datasheets/HW5P-1.pdf" rel="nofollow noreferrer">[Datasheet for the Phototransistor]</a></p>
<p><a href="https://www.arduino.cc/documents/datasheets/servoMotor.PDF" rel="nofollow noreferrer">[Datasheet for the Servo motor]</a></p>
<p><a href="https://www.arduino.cc/documents/datasheets/Resistors.pdf" rel="nofollow noreferrer">[Datasheet for the 220 ohm Resistor]</a></p>
<p>Here is what I have so far for the code:</p>
<pre><code>#include &lt;Servo.h&gt;
Servo myServo;
const int transistorPin1 = A0;
const int transistorPin2 = A1;
const int transistorPin3 = A2;
const int transistorPin4 = A3;
void setup() {
  myServo.attach (10);
  Serial.begin (9600);
}
void loop() {
 int reading1 = analogRead (transistorPin1);
 int reading2 = analogRead (transistorPin2);
 int reading3 = analogRead (transistorPin3);
 int reading4 = analogRead (transistorPin4);
 int reading [] = {reading1, reading2, reading3, reading4}; //This is an array for the values:
 int maxReading = reading [0], maxSensor = 1; // I am setting the maximum reading and the Phototransistor that corresponds to it:
   for (int i = 1; i &lt;= 3; i++){ //Setting this for the other three phototransistors:
     if (reading[i] &gt; maxReading){  
     maxReading = reading[i];
     maxSensor = i + 1;
     }
   }
}
</code></pre>
<p>So my question is: What is the most efficient way to compute the angle of the lighsource? And is my method even relevant for this application?</p>
<p>Thank you for taking you time to read this! Your support will be very much appreciated!</p>
<p><strong>Edit 1:</strong></p>
<p>Explanation of my hardware setup:</p>
<p>This project is allocated on two connected breadboards which means that there are no moving parts. The only moving component is the one single servo that is fixed in position.</p>
<p>The phototransistors, (as mentioned above), are placed in a V configuration which too are stationary. The servo is allocated behind the phototransistors and can only rotate 180 degrees. (You can see the attached illustrations below, I apologize in advance for any technical errors or my horrible drawings.)
<a href="https://i.stack.imgur.com/rzPfH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rzPfH.jpg" alt="Project Setup Illustration:" /></a><br />
<a href="https://i.stack.imgur.com/Vhxr3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vhxr3.jpg" alt="Connection Diagram:" /></a></p>
<p>As you can visualize on the first image, I do not plan on a complete 360 degree rotation which probably complicates the issue further. Any suggestions on how I can code this would be greatly appreciated! Once again thank you for your time.</p>
 37735: <p>In principle, you only need two phototransistors, a left and a right one. The quotient of the values from the ad-convertor (Vleft/Vright) will tell you where to find the light source. If the quotient &gt; 1 then the light source is at the left side, if the quotient &lt; 1 then the light source is at the right side. Most likely there is no lineair relationship between the quotient and the angular position of the light source. This relationship depends on the housing and the positioning of the diodes in their housings. One possibility is to do a calibration beforehand and use a lookup table during operation. The calibration could be done by placing the breadboard with photodiodes on a rotating platform with the light source in front and then record Vleft and Vright at various angles (in 1 degree steps?) of the platform in relation to the light source.
If two photoresistors don't give you the required precision and/or range, you can use more photoresistors and use the pair which is best 'looking' in the direction of the light source.</p>
